-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markers and storing map-related objects in vue component data break map layout #58
Comments
There isn't much to do. Just don't store Map object in created() {
this.map = null // here we define map as non-reactive
},
methods: {
initMap(map) {
this.map = map
const mapboxgl = require('mapbox-gl/dist/mapbox-gl')
this.addMarkers(mapboxgl, map)
}
} Similar issue with VueMapbox library. |
Ok thanks. I moved away from vue-mapbox anyway. It was too rigid for my use-case. |
Had the same issue and couldn't figure out why.. The sea would disappear for a grey background Would be nice to document this To make the map non reactive you should do:
Oddly enough this issue didn't happen with the library |
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
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
The text was updated successfully, but these errors were encountered: