From 22c21322c1640848fb511066d27de4881a494eee Mon Sep 17 00:00:00 2001 From: jmkiley Date: Wed, 4 Sep 2019 10:51:19 -0700 Subject: [ios] Restore NSUserDefaults --- platform/ios/src/MGLMapView.mm | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- cgit v1.2.1