Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling animatedMarker.stop() from an event listener #18

Open
clhenrick opened this issue Feb 15, 2014 · 1 comment
Open

calling animatedMarker.stop() from an event listener #18

clhenrick opened this issue Feb 15, 2014 · 1 comment
Labels

Comments

@clhenrick
Copy link

Having problems getting the marker to stop at a specific lat lon using the Leaflet 'move' event listener.
A live example is available here and code is available here

@atogle atogle added the bug label Feb 18, 2014
@madani2010
Copy link

The same function u are using to center marker can be used to stop it at certain latlng. animated marker Latlng can be accessed using getLatLngs() since the animated marker is a marker:

setInterval(function(){
                map.panTo(animatedMarker.getLatLngs());
if(animatedMarker.getLatLngs().lat == mylat && animatedMarker.getLatLngs().lng == mylng )
{
// do something;
}
            }, 100);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants