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

Implementation of flyTo. #3171

Merged
merged 1 commit into from
Dec 10, 2015
Merged

Implementation of flyTo. #3171

merged 1 commit into from
Dec 10, 2015

Conversation

adam-mapbox
Copy link
Contributor

@1ec5 @jfirebaugh @incanus @bleege @mapbox/mobile

Open for suggestions about the API on MGLMapView.

@adam-mapbox
Copy link
Contributor Author

@@ -218,6 +218,10 @@ IB_DESIGNABLE
* @param completion The block to execute after the animation finishes. */
- (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion;

#pragma mark - flyTo

- (void)flyTo:(CLLocationCoordinate2D *)coordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction completionHandler:(nullable void (^)(void))completion;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should take an MGLMapCamera and be called -flyToCamera:withDuration:completionHandler:. This would also allow you to fly to a tilted viewpoint, looking at a particular coordinate from a particular coordinate, and not have to worry about calculating the pitch you want. We don't need more variations on -setCenterCoordinate:, and in fact I'm about to propose that we deprecate some of them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A further idea would be to allow the developer to specify a maximum airspeed velocity instead of a duration, but that can happen in a separate PR if desired.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this declaration needs a documentation comment. I would say something about the trajectory being parabolic versus -setCamera which transitions the viewport properties linearly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@incanus
Copy link
Contributor

incanus commented Dec 3, 2015

As on #3172, I think we should take a swipe at Android implementation soon after we're happy and land this.

Refs #2805 @zugaldia

@bleege
Copy link
Contributor

bleege commented Dec 10, 2015

Android Implementation is going to be #3244

@bleege bleege mentioned this pull request Dec 11, 2015
@adam-mapbox adam-mapbox deleted the adam_256_flyTo branch December 11, 2015 23:05
@jfirebaugh jfirebaugh mentioned this pull request Dec 15, 2015
1ec5 added a commit that referenced this pull request 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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants