Leaflet.AnimatedMarker icon indicating copy to clipboard operation
Leaflet.AnimatedMarker copied to clipboard

when "zoom ing", the marker slides to the correct position instead of snapping to it

Open calbu opened this issue 8 years ago • 2 comments

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

calbu avatar Jun 22 '16 15:06 calbu

I also ran into this same issue. Is there any workaround for this?

jpremkumar avatar Apr 12 '19 10:04 jpremkumar

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);

glasmasin avatar Jun 11 '20 15:06 glasmasin