Skip to content

Markers and storing map-related objects in vue component data break map layoutΒ #58

@Jones-S

Description

@Jones-S

Hi

I am trying to use mapbox with mapbox gl to add markers and lines.
I also would like to save a reference of the map in the data object, like you mention here:
#23

This alone works, but I am also requiring mapbox gl to add markers.
Like mentioned here: #47
together with nuxt.

Somehow this

methods: {
  initMap(map) {
    this.map = map
    const mapboxgl = require('mapbox-gl/dist/mapbox-gl')
    this.addMarkers(mapboxgl, map)
  },

will again cause the map to look very weird.
(It loads ok initially but then it switches to this grey overlay:
https://user-images.githubusercontent.com/7059580/52290750-0f861700-2971-11e9-92ac-bc45accde1f3.png)

I also mentioned this behaviour in issue #57.
There I wanted to save the markers in the data object.

So somehow this is all a bit weird, but I don't have a clue where to start.
If anyone has a hint for me, I would be very thankful.

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions