ewoken / Leaflet.MovingMarker

A Leaflet plug-in to create moving marker
MIT License
342 stars 177 forks source link

While zooming the marker is moving on wrong line #37

Open M1Ergash opened 4 years ago

M1Ergash commented 4 years ago

I zoomed while marker was moving but it is going on different way. Once you zoomed the marker gets right position. Any way to keep marker always on its way? thank you in advance! image_2020-03-28_10-57-48

M1Ergash commented 4 years ago

Please help to solve this

M1Ergash commented 4 years ago

Here is the solution for the case. I decided to add listeners. I hope it will help for other devs

    `map.on('zoomstart', function() {
        myMovingMarker.pause();
    });

    map.on('zoomend', function() {
        myMovingMarker.start();
    });`
MiguelLucas commented 4 years ago

This solution worked perfectly for me!