Closed tommed closed 4 years ago
Is anyone monitoring these bugs please?
I had a bug of messing up my map from popups and maybe it might help here as well. even tho I have no clue why. Its more of an interplay between vue and mapbox... anyway
try instead of this
this.marker = utils
.sectorMarker(s, this.mapbox)
.setPopup(this.popup);
.addTo(this.map);
this:
this.marker = utils
.sectorMarker(s, this.mapbox)
.setPopup(this.popup);
this.marker.addTo(this.map);
weird, but fixed it for me
Looking at the code, I don't think there's a reason why this should fix anything - perhaps it just stopped breaking for you or something else was changed? I found my issue was with the mapbox vue component. You use this.$control = ...
to set the control and it adds it to the map under-the-hood. I replaced this code with my own and it started working again :-/
Apologies if this turns out not to be your component's fault, but I'm having some difficulty adding markers to the map without the map's rendering being affected.
I essentially have a map element which after it has loaded I am attempting to add a marker. When the marker is added, it stops the map from drawing details. I have added console logging and am confident the map is loaded at the point the marker is added:
mapbox-gl-js version: 1.9.1 mapbox-gl-draw version: 1.1.2
Code snippets
Hopefully this code will help prompt the problem (especially if I'm doing something wrong!),
EditPlan.vue
Map.vue
MapMarkers.vue
MapMarker.vue
map-utils.js