vue-mapbox icon indicating copy to clipboard operation
vue-mapbox copied to clipboard

Marker issue

Open maartenvw opened this issue 5 years ago • 2 comments

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?

maartenvw avatar Aug 20 '20 17:08 maartenvw

same issue here @maartenvw did you figured out ?

damienroche avatar Aug 31 '20 16:08 damienroche

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;
      }
    };
  },

maartenvw avatar Aug 31 '20 16:08 maartenvw