-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
@@ -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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
c4ba6d8
to
095a8be
Compare
Android Implementation is going to be #3244 |
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 @jfirebaugh @incanus @bleege @mapbox/mobile
Open for suggestions about the API on MGLMapView.