-
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
Fly across the antimeridan if shorter #1857
Conversation
Can you add a test please? |
We don’t have any
In the absence of #1854, I’m making the transition synchronous by setting ref #1773 |
Does using |
@jfirebaugh I think this is a valid bug, we should set a final position here https://github.com/mapbox/mapbox-gl-js/blob/master/js/ui/camera.js#L632 |
@mourner I don't think that should be necessary. The first function passed to |
If the flight path covers no ground, ease to the new camera, so that the requested bearing and pitch take effect. Also, only apply an offset when a new center is requested, for consistency with easeTo().
Based on easeTo() tests, but without the around option and with some additional checks to ensure that the aircraft actually takes off and crosses the prime meridian or antemeridian.
Tests added and edge cases fixed. See the original comment, which I’ve edited, for details. |
👍 Awesome |
If flying across the antimeridian yields a shorter flight path than flying across the Prime Meridian, cross the antimeridian. This PR also adds a full complement of unit tests based on the
easeTo()
unit tests and fixes a couple corner cases that differ betweeneaseTo()
andflyTo()
: now, if you fly to the current location but with a different zoom level, bearing, or pitch, we ease to the new camera instead of bailing. We also avoid offsetting if theoptions
don’t call for a new center point.Fixes #1853. Ported from mapbox/mapbox-gl-native@97c143a for mapbox/mapbox-gl-native#3355.
/cc @mourner @lucaswoj