-
-
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
fix vector drifts when zoomAnimation
is false
and zooming via flyTo
or pinch
#8794
Conversation
@plainheart the fix looks great, thank you for looking into this! Since it's not covered by tests currently, I wonder if it would be covered by #8644 — can you take a look? Let's see if it passes if we turn zoomAnimation off there with this fix applied, and fails without. |
I'm not familiar with how to add test cases, so I'd like to ask you to help me to add some appropriate test cases. Thanks! |
@plainheart oh, I mean there's already a test case written in that PR — we just need to check if it still passes with zoomAnimation: false and this fix. |
204b114
to
ae37376
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mourner I added the test with zoomAnimation: false
.
The current lint error in the main will be fixed with this to.
The reason why this is working is because dragging is prevented: Line 81 in 9793d0a
|
Would love to see this in the next release. +1 |
* Update Rotate.js and CompassBearing.js Removed call to non existing function '_unthrottledOnDeviceOrientation' Higher throttling for smoother rotation on device orientation change. Preparation for iOS support. * clean up code + add `deviceorientationabsolute` listener * wrong `off` method * restore: `webkitCompassHeading` = 360 - `alpha` Safari on iOS doesn't implement the spec correctly, because alpha is arbitrary instead of relative to true north. Safari instead offers webkitCompassHeading`, which has the opposite sign to alpha and is also relative to magnetic north instead of true north * automatically disable compass bearing handler on unsupported device * Update index.html This should be 'ondeviceorientation' instead of 'ondeviceorientationabsolute' * Update CompassBearing.js This should be 'ondeviceorientation' instead of 'ondeviceorientationabsolute' * Update Renderer.js Fix for drifting * Apply patch from: Leaflet/Leaflet#8794 * missing semicolon --------- Co-authored-by: Johnny Visser <johnny.visser@spie.com> Co-authored-by: Raruto <Raruto@users.noreply.github.com>
…yTo` or pinch (#8794) Co-authored-by: Florian Bischof <design.falke@gmail.com>
…yTo` or pinch (#8794) Co-authored-by: Florian Bischof <design.falke@gmail.com>
…yTo` or pinch (#8794) Co-authored-by: Florian Bischof <design.falke@gmail.com>
Background
First I'd like to thank @mourner for the fix in #8103, which makes it work when
zoomAnimation
istrue
.However, as mentioned in #7466, #8644, and my #8103 (comment), it doesn't work when
zoomAnimation
is set asfalse
.You can refer to the test case
debug/vector/vector-drift.html
added in this PR to reproduce or the online demo provided by #7466.In this PR, I tried to set the
transform-origin
as0 0
for the container of the SVG/Canvas renderer. By default, it might becenter
. I'm not sure if it is right way to fix this bug but it works indeed and looks simple.closes #8117
Comparison