summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLMapView.h
diff options
context:
space:
mode:
authorMark Allen <mark.a.allen@gmail.com>2016-06-09 20:05:15 -0400
committerMinh Nguyễn <mxn@1ec5.org>2016-06-09 17:05:50 -0700
commitdd565b701b20cac69f7a84a02e7bc8a783c92bb6 (patch)
treeb5ed346e30aac9f75e5622b2ea901d7f6b550c5f /platform/ios/src/MGLMapView.h
parent4e808994cb7611090c234875cffc18f0f3ef8088 (diff)
downloadqtlocation-mapboxgl-dd565b701b20cac69f7a84a02e7bc8a783c92bb6.tar.gz
[ios] Support for a customizable zoom gesture centering strategy. (#5302)
* [ios] Support for a customizable zoom gesture centering strategy. We introduce a new MGLZoomGestureCentering enum and corresponding zoomGestureCentering property on MGLMapView. Currently, Mapbox automatically adjusts the center of the map relative to the user's gesture location, but for some applications (e.g Uber, Lyft) it is preferable to keep the map center "locked" in response to zoom gestures. Exisiting code will retain its current behavior without modification and will implicitly use the default value of MGLZoomGestureCenteringFollowsTouch. New code can specify MGLZoomGestureCenteringLockedInPlace to get the new "locked" behavior. * [ios] Added -anchorPointForGesture: to MGLMapView Cherry-picked from b915f05a069d4658cc11d91a4bae2ef52c5fcbf1.
Diffstat (limited to 'platform/ios/src/MGLMapView.h')
-rw-r--r--platform/ios/src/MGLMapView.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h
index 63d799bda9..09142c4093 100644
--- a/platform/ios/src/MGLMapView.h
+++ b/platform/ios/src/MGLMapView.h
@@ -763,6 +763,25 @@ IB_DESIGNABLE
- (MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets;
/**
+ Returns the point in this view's coordinate system on which to "anchor" in
+ response to a user-initiated gesture.
+
+ For example, a pinch-to-zoom gesture would anchor the map at the midpoint of
+ the pinch.
+
+ If the `userTrackingMode` property is not `MGLUserTrackingModeNone`, the
+ user annotation is used as the anchor point.
+
+ Subclasses may override this method to provide specialized behavior - for
+ example, anchoring on the map's center point to provide a "locked" zooming
+ mode.
+
+ @param gesture An anchorable user gesture.
+ @return The point on which to anchor in response to the gesture.
+ */
+- (CGPoint)anchorPointForGesture:(UIGestureRecognizer *)gesture;
+
+/**
The distance from the edges of the map view’s frame to the edges of the map
view’s logical viewport.