Skip to content Skip to sidebar Skip to footer

Programmatically Change Offset Of Mapbox Marker Via Javascript

Following on from this question I asked yesterday... I am adding MapBox Markers to an array like so: var el = document.createElement('div' + index); el.className = 'marker'; device

Solution 1:

There is no way to do this with the current API. I would recommend you just make a new marker with the new offset and the existing element (i.e. new mapboxgl.Marker(oldMarker.getElement(), ...) and then remove the old marker)


Post a Comment for "Programmatically Change Offset Of Mapbox Marker Via Javascript"