diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-12-05 22:22:46 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-12-13 17:26:53 -0800 |
commit | 0fb2b855a4539803f42a4048257da606f66d9f4e (patch) | |
tree | 7be98f423e47a40aa6d011c5e52751d0896125e0 /include/mbgl/osx/MGLMapView.h | |
parent | 3f2fae521cde0cc07796f65b33a227875466dc8d (diff) | |
download | qtlocation-mapboxgl-0fb2b855a4539803f42a4048257da606f66d9f4e.tar.gz |
[osx] Map camera
Shared MGLMapCamera between iOS and OS X. Unfortunately -camera and -setCamera: implementations need to be copy-pasted for now.
Diffstat (limited to 'include/mbgl/osx/MGLMapView.h')
-rw-r--r-- | include/mbgl/osx/MGLMapView.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/mbgl/osx/MGLMapView.h b/include/mbgl/osx/MGLMapView.h index 0a6a43ed12..41f7e02c84 100644 --- a/include/mbgl/osx/MGLMapView.h +++ b/include/mbgl/osx/MGLMapView.h @@ -23,6 +23,7 @@ typedef NS_OPTIONS(NSUInteger, MGLMapDebugMaskOptions) { }; @class MGLAnnotationImage; +@class MGLMapCamera; @protocol MGLAnnotation; @protocol MGLMapViewDelegate; @@ -223,6 +224,31 @@ IB_DESIGNABLE coordinate or zoom level. */ - (void)setDirection:(CLLocationDirection)direction animated:(BOOL)animated; +/** A camera representing the current viewpoint of the map. */ +@property (nonatomic, copy) MGLMapCamera *camera; + +/** Moves the viewpoint to a different location with respect to the map with an + optional transition animation. + + @param camera The new viewpoint. + @param animated Specify `YES` if you want the map view to animate the change + to the new viewpoint or `NO` if you want the map to display the new + viewpoint immediately. */ +- (void)setCamera:(MGLMapCamera *)camera animated:(BOOL)animated; + +/** Moves the viewpoint to a different location with respect to the map with an + optional transition duration and timing function. + + @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 function A timing function used for the animation. Set this parameter + to `nil` for a transition that matches most system animations. If the + duration is `0`, this parameter is ignored. + @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; + /** The geographic coordinate bounds visible in the receiver’s viewport. Changing the value of this property updates the receiver immediately. If you |