diff options
author | jmkiley <jordan.kiley@mapbox.com> | 2019-09-04 10:51:19 -0700 |
---|---|---|
committer | jmkiley <jordan.kiley@mapbox.com> | 2019-09-04 10:51:19 -0700 |
commit | 22c21322c1640848fb511066d27de4881a494eee (patch) | |
tree | 4307186d69c9a1fbf711bf5e15b8dc4507d211d2 | |
parent | 30ccadfc2162be49c6e56063461a6860188d740e (diff) | |
download | qtlocation-mapboxgl-upstream/jmkiley-rotation-flag.tar.gz |
[ios] Restore NSUserDefaultsupstream/jmkiley-rotation-flag
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index d2e430177f..2e96931a63 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -128,6 +128,9 @@ const CLLocationDirection MGLToleranceForSnappingToNorth = 7; /// Distance threshold to stop the camera while animating. const CLLocationDistance MGLDistanceThresholdForCameraPause = 500; +/// Rotation threshold while a pinch gesture is occurring. +static NSString * const MGLRotationThresholdWhileZoomingKey = @"MGLRotationThresholdWhileZooming"; + /// Reuse identifier and file name of the default point annotation image. static NSString * const MGLDefaultStyleMarkerSymbolName = @"default_marker"; @@ -1779,6 +1782,9 @@ public: self.cameraChangeReasonBitmask |= MGLCameraChangeReasonGestureRotate; + if ([[NSUserDefaults standardUserDefaults] objectForKey:MGLRotationThresholdWhileZoomingKey]) { + self.rotationThresholdWhileZooming = [[[NSUserDefaults standardUserDefaults] objectForKey:MGLRotationThresholdWhileZoomingKey] floatValue]; + } // Check whether a zoom triggered by a pinch gesture is occurring and if the rotation threshold has been met. if (MGLDegreesFromRadians(self.rotationBeforeThresholdMet) < self.rotationThresholdWhileZooming && self.isZooming && !self.isRotating) { self.rotationBeforeThresholdMet += fabs(rotate.rotation); |