summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-12-05 22:22:46 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-12-13 17:26:53 -0800
commit0fb2b855a4539803f42a4048257da606f66d9f4e (patch)
tree7be98f423e47a40aa6d011c5e52751d0896125e0 /include/mbgl
parent3f2fae521cde0cc07796f65b33a227875466dc8d (diff)
downloadqtlocation-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')
-rw-r--r--include/mbgl/darwin/MGLMapCamera.h (renamed from include/mbgl/ios/MGLMapCamera.h)0
-rw-r--r--include/mbgl/osx/MGLMapView.h26
2 files changed, 26 insertions, 0 deletions
diff --git a/include/mbgl/ios/MGLMapCamera.h b/include/mbgl/darwin/MGLMapCamera.h
index 7c00ad8665..7c00ad8665 100644
--- a/include/mbgl/ios/MGLMapCamera.h
+++ b/include/mbgl/darwin/MGLMapCamera.h
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