-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Feature: add callback for animations #5350
Comments
It doesn't look like the linked example provides any useful information, am I missing something? You could add a one-time map.flyToBounds(bounds);
map.once('moveend', function() {
map.setMaxBounds(bounds);
}); |
I think you aremissing somthing, look at the javascript tab. |
There is a problem. |
Ok, could you provide an illustration of the issue? I modified your previous example with a |
Ok, I've updated the example. http://playground-leaflet.rhcloud.com/xiwi/1/edit?html,js,output In some cases, when moving is stopped, the marker appears a little later (probably corresponding to the end of automatic movement). In the other, it does not appear at all. |
I was able to reproduce this problem by just clicking (not dragging) the map while the flyTo animation was running. My guess is that the click aborts the animation since the user begins a pan operation, but since the map is actually never dragged, no |
Ok, I repeat, sometimes the event is still launched. |
Hello,
I'm using version 1.0.3
You can't set the boundary and use an animation at the same time, like this:
Exemple : http://playground-leaflet.rhcloud.com/yeya/1/edit
One solution is by adding "moveend" listener who will launch setMaxBounds once the animation finishes, but it's complicated and we must filter events.
Why not add a "end of the animation" callback function in parameters ?
The text was updated successfully, but these errors were encountered: