diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-12-15 12:51:15 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-12-15 12:52:13 -0800 |
commit | 4e0e8166539a03fb5180b813b27d8fff87850a37 (patch) | |
tree | c05687465673afaea1d81b0b276b4da913cc8c47 /include/mbgl | |
parent | 5dd00d10720652852ede07b82a25c88cddc4892c (diff) | |
download | qtlocation-mapboxgl-4e0e8166539a03fb5180b813b27d8fff87850a37.tar.gz |
[ios, osx] Added flyToCamera: variation that uses default duration
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/ios/MGLMapView.h | 11 | ||||
-rw-r--r-- | include/mbgl/osx/MGLMapView.h | 12 |
2 files changed, 18 insertions, 5 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index e122874e37..f9c8296221 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -218,10 +218,15 @@ 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; +/** Uses a ballistic parabolic motion to "fly" the viewpoint to a different location with respect to the map with a default duration based on the length of the flight path. +* @param camera The new viewpoint. +* @param completion The block to execute after the animation finishes. */ +- (void)flyToCamera:(MGLMapCamera *)camera completionHandler:(nullable void (^)(void))completion; + /** Uses a ballistic parabolic motion to "fly" the viewpoint to a different location with respect to the map with an optional transition duration. - * @param camera The new viewpoint. - * @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to jump to the new viewpoint instantaneously. - * @param completion The block to execute after the animation finishes. */ +* @param camera The new viewpoint. +* @param duration The amount of time, measured in seconds, that the transition animation should take. Specify `0` to use the default duration, which is based on the length of the flight path. +* @param completion The block to execute after the animation finishes. */ - (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion; #pragma mark - Converting Map Coordinates diff --git a/include/mbgl/osx/MGLMapView.h b/include/mbgl/osx/MGLMapView.h index 5241329f3d..40fd2a6bc4 100644 --- a/include/mbgl/osx/MGLMapView.h +++ b/include/mbgl/osx/MGLMapView.h @@ -250,12 +250,20 @@ IB_DESIGNABLE - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion; /** Uses a ballistic parabolic motion to “fly” the viewpoint to a different + location with respect to the map with a default duration based on the length + of the flight path. + + @param camera The new viewpoint. + @param completion The block to execute after the animation finishes. */ +- (void)flyToCamera:(MGLMapCamera *)camera completionHandler:(nullable void (^)(void))completion; + +/** Uses a ballistic parabolic motion to “fly” the viewpoint to a different location with respect to the map with an optional transition duration. @param camera The new viewpoint. @param duration The amount of time, measured in seconds, that the transition - animation should take. Specify `0` to jump to the new viewpoint - instantaneously. + animation should take. Specify `0` to use the default duration, which is + based on the length of the flight path. @param completion The block to execute after the animation finishes. */ - (void)flyToCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion; |