-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Vector layers drift away on flyTo when zoomAnimation = false #7466
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
Comments
Perhaps same roots as in #7072 |
Does this just happen with pinch-zoom/panning on a touchscreen? |
This happens by programmatically triggering the flyTo/flyToBounds method e.g. through a button. I experience this in Firefox and Chromium on a Laptop running Ubuntu. There is no built-in touchscreen. |
I have got a more general applicable workaround that might help: const originalOnAdd = L.Renderer.prototype.onAdd
L.Renderer.prototype.onAdd = function () {
originalOnAdd.call(this)
if (!this._zoomAnimated) {
L.DomUtil.addClass(this._container, 'leaflet-zoom-animated')
}
} It specifically runs the excluded code path in Renderer.js - onAdd method where the |
Cool! |
I can offer to investigate further as soon as I have the time. Could be next week. |
Any progress on this? we can still see this happening.. |
Please check out the latest beta https://github.com/Leaflet/Leaflet/releases/tag/v1.8.0-beta.3 and see if everything's resolved? |
Steps to reproduce
Steps to reproduce the behavior:
zoomAnimation: false
Expected behavior
Vector layers follow the movement of the map.
Current behavior
Vector layers drift away while panning. When the target is reached they snap to their proper location.
This is even more perceptible when the zoom levels between the current position and the target differ.
Environment
Additional context
My current workaround is to set
mapInstance._zoomAnimated = true
before I add a layer andmap._zoomAnimated = false
right after. This way the animation handler will be registered in src/layer/vector/Renderer.js while keeping the zoom animation disabled.Minimal example reproducing the issue
https://plnkr.co/edit/qHqGIded24Z4MYtO
The text was updated successfully, but these errors were encountered: