-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 easeTo interpolation on pitched maps #4540
Conversation
This turned out to be more complicated than I thought. We can't simply interpolate linearly through projected center because e.g. as you zoom in to a non-centered point, the scale increases exponentially while map center interpolates linearly, leading to a curved animation. |
OK, I think I finally got this right, with proper offset handling, and the tests pass. The easing while zooming interpolation formula is still probably not 100% scientifically correct, but it works well in practice, and me and @anandthakker couldn't come up with anything better. I'd like to improve the easing code further as there is still some logic duplication going on between |
@1ec5 should this be ported to native? It changes the way |
The native implementation of |
A PR in place of #4320. Should close #4178 and #3112.
Changes
easeTo
implementation to have more robust interpolation, fixing weird behavior on pitched maps, making it more consistent withflyTo
, and makes the definition ofoffset
less ambiguous.Haven't updated expected values in the camera tests, but otherwise this is ready for review.
cc @joswinter
Launch Checklist
post benchmark scores