leaflet-geosearch icon indicating copy to clipboard operation
leaflet-geosearch copied to clipboard

flyTo buggy when it happens offscreen (probably problem with request Animation frame?)

Open montella1507 opened this issue 1 year ago • 0 comments

Hi,

please check attached video:

https://github.com/user-attachments/assets/93780b49-def1-443c-a09f-a20713aef7cd

When flyTo happens when onscreen and "animation frames" are stable, everything is OK. However, when flyTo happens outside the screen (for the instance - when tab is not visible), polygons and other things are not positioned correctly...

It looks like not all steps of the animation are "triggered", because not so many animation framews were triggered? https://github.com/Leaflet/Leaflet/blob/main/src/map/Map.js#L356

Interesting fact is, panTo works without any issues.

When i log how many times the "animation function" is called it is like 14x when it works and only once when it does not.

montella1507 avatar Sep 12 '24 14:09 montella1507