vue-mapbox
vue-mapbox copied to clipboard
Marker issue
Whenever I dynamically create a marker for example by using the v-for loop. The map goes back to the center every time I add a marker or update a marker.
How can this be resolved to not happen?
same issue here @maartenvw did you figured out ?
Yes sort off I created the map without the use of the map component and inside it I added the markers and then it stop centering.
You need to provide the map and mapbox for the markers to keep working.
provide() {
const self = this;
return {
get mapbox() {
return self.mapbox;
},
get map() {
return self.map;
}
};
},