summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-01-15 08:25:56 -0800
committerMinh Nguyễn <mxn@1ec5.org>2016-01-18 16:54:57 -0800
commitc86646519a4887d47003d11061a6a82e7ff4241c (patch)
tree804e8e03499c4032eef79757c0ccd235e5c7540e /include
parent143f8a78170065fc46afba1eaf987258e9c9f99b (diff)
downloadqtlocation-mapboxgl-c86646519a4887d47003d11061a6a82e7ff4241c.tar.gz
[osx] Content insets
Added a contentInsets property to MGLMapView that behaves similarly to NSScrollView.contentInsets. Adjust it according to the window’s content layout rectangle using KVO. Automatically apply the content insets whenever creating a CameraOptions or getting the center coordinates.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/osx/MGLMapView.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/mbgl/osx/MGLMapView.h b/include/mbgl/osx/MGLMapView.h
index df4b597847..971477b42e 100644
--- a/include/mbgl/osx/MGLMapView.h
+++ b/include/mbgl/osx/MGLMapView.h
@@ -308,6 +308,31 @@ IB_DESIGNABLE
and zooming or `NO` to immediately display the given bounds. */
- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds animated:(BOOL)animated;
+/** A Boolean value indicating whether the receiver automatically adjusts its
+ content insets.
+
+ When the value of this property is `YES`, the map view automatically updates
+ its `contentInsets` property to account for any overlapping title bar or
+ toolbar. To overlap with the title bar or toolbar, the containing window’s
+ style mask must have `NSFullSizeContentViewWindowMask` set, and the title
+ bar must not be transparent.
+
+ The default value of this property is `YES`. */
+@property (nonatomic, assign) BOOL automaticallyAdjustsContentInsets;
+
+/** The distance from the edges of the map view’s frame to the edges of the map
+ view’s logical viewport.
+
+ When the value of this property is equal to `NSEdgeInsetsZero`, viewport
+ properties such as `centerCoordinate` assume a viewport that matches the map
+ view’s frame. Otherwise, those properties are inset, excluding part of the
+ frame from the viewport. For instance, if the only the top edge is inset,
+ the map center is effectively shifted downward.
+
+ When the value of the `automaticallyAdjustsContentInsets` property is `YES`,
+ the value of this property may be overridden at any time. */
+@property (nonatomic, assign) NSEdgeInsets contentInsets;
+
#pragma mark Configuring gesture recognition
/** @name Configuring How the User Interacts with the Map */