Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

flyTo launches into geosynchronous orbit #3296

Closed
1ec5 opened this issue Dec 15, 2015 · 3 comments · Fixed by #3301 or #3355
Closed

flyTo launches into geosynchronous orbit #3296

1ec5 opened this issue Dec 15, 2015 · 3 comments · Fixed by #3301 or #3355
Assignees
Labels
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Dec 15, 2015

If I start out at zoom level A and invoke mbgl::Map::flyTo() with a zoom level B, such that B > A, the viewpoint ends up at zoom level A. Moreover, the trajectory isn’t capped at the minimum zoom level. So when flying from San Francisco at about z7 to Washington, D.C., at z18, the zoom level quickly goes into NaN territory:

8.864151
8.864048
8.864014
8.863978
8.863908
<snip>
7.761990
7.715285
7.634145
7.585074
7.440956
7.289616
7.224786
7.116410
7.056992
6.781923
6.344395
6.152671
5.933951
5.434996
1.683239
nan
nan
<snip>
nan
nan
1.752706
4.793166
6.483146
6.859785
7.262993
7.402360
7.712066
7.781944
7.873764
7.889215
7.942035
7.958733
8.016303
8.134719
8.194865
8.200802
8.254453
<snip>
8.867422
8.867423
8.867423
8.867423
8.867423
8.867423
8.867423

/cc @adam-mapbox

@1ec5 1ec5 added the bug label Dec 15, 2015
@1ec5 1ec5 added this to the ios-v3.1.0 milestone Dec 15, 2015
@1ec5 1ec5 self-assigned this Dec 15, 2015
@lucaswoj
Copy link
Contributor

na

@lucaswoj lucaswoj reopened this Dec 15, 2015
1ec5 added a commit that referenced this issue Dec 15, 2015
Corrected some fairly opaque code that was incorrectly ported from GL JS the first time around in #3171, causing the trajectory to extend far into the Earth’s orbit. Also transition pitch while flying, call transition frame/finish callback functions, and recognize the same “speed” and “curve” parameters that GL JS does.

Fixes #3296, fixes #3297.
@1ec5
Copy link
Contributor Author

1ec5 commented Dec 16, 2015

As @adam-mapbox pointed out, we aren’t calculating quite the right zoom levels. After removing the zoom level clamp I added in #3301, I was able to fly from California to D.C., causing the zoom level to vary from 6.475008 to -8.283377 to 23.004506.

@1ec5 1ec5 reopened this Dec 16, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Dec 18, 2015

For my own reference, flyTo() was originally introduced in mapbox/mapbox-gl-js@da42a4a as an implementation of van Wijk ‎2003 “optimal path” animations.

1ec5 added a commit that referenced this issue Dec 20, 2015
Rewrote the flyTo implementation to more closely match GL JS’s implementation and the paper on which it is based.

Rewrote CameraOptions documentation. Only document units for generic types like double. The semantics of LatLng and Duration are already baked into the types; one just needs to look up the types’ definitions. Also, the […) is set notation, so the braces are supposed to be mismatched.

Fixes #3296.
@1ec5 1ec5 removed the in progress label Dec 20, 2015
1ec5 added a commit that referenced this issue Dec 20, 2015
Rewrote the flyTo implementation to more closely match GL JS’s implementation and the paper on which it is based.

Rewrote CameraOptions documentation. Only document units for generic types like double. The semantics of LatLng and Duration are already baked into the types; one just needs to look up the types’ definitions. Also, the […) is set notation, so the braces are supposed to be mismatched.

Fixes #3296.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants