Animate stops if map.updateSize() is executed while animation is running
See original GitHub issueI am working on an app in Angular 8 for a year and i didn’t have a problem with this. I guess that it has to do with some major changes in Openlayers v6.
Describe the bug
After upgrading to v6.1.1 from 5.3.3, i had a problem with animation process.
When i initiate view.animate(...)
and use all parameters well, i see part of the navigation and zoomin animation, but it stops after certain time (300ms) in my case.
To Reproduce
Apart from this animate code i have part of my code that executes map.updateSize()
method and it is executed after 300ms time out because of new elements that change viewport size (300ms is just an arbitrary value).
When i found that this is causing the animation stop, i bound map size update to some click event and it stops the animation the same.
Expected behavior In the previous version (5.3.3) i had this size updating and it didn’t stop the animation. Not sure if this is a bug or expected changed behavior but it could break some more projects that rely on updating size after some viewport size changes.
Since this updateSize()
is an important method in your API, i propose that you maybe add this to your API documentation for animation along side those other methods that cancel animation that you mentioned.
Either way, i fixed it by adding map size update method as callback to animate
sequence. But this is only because for my case, animation happens after viewport changing elements are already shown.
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
There is no funding for this that I know of, so the answer is no.
Hi,
Would you be able to provide a simple reproduction case in codepen or similar? Your description is a good start but actually investigating this issue will require to reproduce it one way or another. Thanks!