Leaflet.AnimatedMarker
Leaflet.AnimatedMarker copied to clipboard
when "zoom ing", the marker slides to the correct position instead of snapping to it
when a marker stops at the end of a line, if you zoom in or out the marker will slowly slide to the correct position. the same behavior is encountered during the movement of a marker if you zoom in or out. please let me know if I am doing something wrong or if I can correct this. thank you
I also ran into this same issue. Is there any workaround for this?
You can do something like this to hide it while zooming:
function toggleVisibility(e) {
if (e.type === 'zoomstart') {
map.removeLayer(animatedMarker)
}
if (e.type === 'zoomend') {
map.addLayer(animatedMarker)
}
}
map.on('zoomstart', toggleVisibility);
map.on('zoomend', toggleVisibility);