question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature: add callback for animations

See original GitHub issue

Hello, I’m using version 1.0.3

You can’t set the boundary and use an animation at the same time, like this:

This.map.flyToBounds (myBounds)
This.map.setMaxBounds (myBounds)

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 ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
perliedmancommented, Feb 21, 2017

It doesn’t look like the linked example provides any useful information, am I missing something?

You could add a one-time moveend listener specifically for your flyTo animation:

map.flyToBounds(bounds);
map.once('moveend', function() {
    map.setMaxBounds(bounds);
});
0reactions
dawadamcommented, Mar 8, 2017

Ok, Good news.

I repeat, sometimes the event is still launched. Test clicking at the end of the movement to stop the map.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature: add callback for animations · Issue #5350 - GitHub
One solution is by adding "moveend" listener who will launch setMaxBounds once the animation finishes, but it's complicated and we must ...
Read more >
Animation Callbacks in Angular | DigitalOcean
We've touched on the basics of animation in Angular, so let's now explore another feature of the animation system: animation callbacks.
Read more >
Is there a callback on completion of a CSS3 animation?
Yes, there is. The callback is an event, so you must add an event listener to catch it. This is an example with...
Read more >
Callback Functions for Effects and Animations - Educative.io
A callback function, for a given effect, is executed after the completion of the effect. Each effect and animation in jQuery takes optional...
Read more >
Adding A Simple Callback Function - #4 - GreenSock 101
Adding A Simple Callback Function - #4 - GreenSock 101 · GreenSock callback functions tutorial for a complete beginners. · Sign up today...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found