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

Further refine flyTo() flight path #3355

Merged
merged 4 commits into from
Dec 20, 2015
Merged

Further refine flyTo() flight path #3355

merged 4 commits into from
Dec 20, 2015

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Dec 18, 2015

This is a followup to #3301 that further refines the flight path used by Transform::flyTo() to match GL JS exactly, even as the pitch varies between the endpoints. It fixes #3296 and ensures that the ending zoom level is respected regardless of the starting zoom level. Finally, I began documenting and renaming variables to reflect a better understanding of this algorithm, now that this paper has been rediscovered.

Other noteworthy changes:

  • Began pushing mutators into TransformState, which will allow us to begin factoring redundant code out of Transform.
  • Addresses flyTo refuses to cross antimeridian mapbox-gl-js#1853 by crossing the antimeridian if that would be a shorter path.
  • Replaces the opaque speed and curve options with more intuitive options that are expressed in screen units.

/cc @bleege @zugaldia @mourner @lucaswoj

@1ec5 1ec5 added the bug label Dec 18, 2015
@1ec5 1ec5 added this to the android-v2.4.0 milestone Dec 18, 2015
@1ec5 1ec5 self-assigned this Dec 18, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Dec 18, 2015

The Linux build failures are all #3163.

@bleege
Copy link
Contributor

bleege commented Dec 18, 2015

Awesome @1ec5! To get this into the 2.4.0 release, please merge this into release-android-v2.4.0 and not master. We'll merge things back over to master after the release.

@1ec5 1ec5 mentioned this pull request Dec 19, 2015
@1ec5 1ec5 added the GL JS parity For feature parity with Mapbox GL JS label Dec 19, 2015
@1ec5
Copy link
Contributor Author

1ec5 commented Dec 20, 2015

Per chat, I’m going to check this into master and cherry-pick into release-android-v2.4.0 to avoid holding up iOS / OS X development while the Android release bakes.

1ec5 added 4 commits December 19, 2015 20:31
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.
The speed and curve fields in CameraOptions have been replaced with velocity and minZoom fields, which expressed in screen units. Scaling and easing make it difficult to derive options that are expressed in physical units.
For consistency with -setCamera:…, a duration of 0 jumps instantaneously to the new location, while a negative value uses the distance-dependent default.

Due to the produced curve and applied easing, flyTo() doesn’t model a parabola or ballistic trajectory, but it does simulate powered flight to some extent.
@1ec5 1ec5 force-pushed the 1ec5-optimal-flight-3296 branch from dd219ca to 2cb70ea Compare December 20, 2015 04:34
@1ec5 1ec5 merged commit 2cb70ea into master Dec 20, 2015
@1ec5 1ec5 removed the in progress label Dec 20, 2015
@1ec5 1ec5 deleted the 1ec5-optimal-flight-3296 branch December 20, 2015 04:47
@1ec5
Copy link
Contributor Author

1ec5 commented Dec 20, 2015

Cherry-picked into release-android-v2.4.0 as 925687a...70ae0cc.

@bleege
Copy link
Contributor

bleege commented Dec 20, 2015

@1ec5 I just tested this off the release branch and it looks great! Thanks much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flyTo launches into geosynchronous orbit
2 participants