From b0bae6d1dde4e8c3b0b0b50d4255e1073f36022a Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Fri, 28 Jul 2017 10:22:16 -0700 Subject: [ios] tilt gesture type fix (#9642) * [ios] Change function:angleBetweenPoints return type * [ios] Update changelog --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index a8efb491dd..43df49a9ac 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -7,6 +7,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Reduced the size of the dynamic framework by optimizing symbol visibility. ([#7604](https://github.com/mapbox/mapbox-gl-native/pull/7604)) * Fixed an issue where the attribution button would have its custom tint color reset when the map view received a tint color change notification, such as when an alert controller was presented. ([#9598](https://github.com/mapbox/mapbox-gl-native/pull/9598)) * Improved the behavior of zoom gestures when the map reaches the minimum zoom limit. ([#9626](https://github.com/mapbox/mapbox-gl-native/pull/9626)) +* Fixed an issue where tilt gesture was triggered with two fingers aligned vertically and panning down. ([#9571](https://github.com/mapbox/mapbox-gl-native/pull/9571)) * Bitcode symbol maps (.bcsymbolmap files) are now included with the dynamic framework. ([#9613](https://github.com/mapbox/mapbox-gl-native/pull/9613)) ## 3.6.0 - June 29, 2017 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 8dbf26da55..9cc4c42e5a 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1848,7 +1848,7 @@ public: east = swap; } - float horizontalToleranceDegrees = 60.0; + CLLocationDegrees horizontalToleranceDegrees = 60.0; if ([self angleBetweenPoints:west east:east] > horizontalToleranceDegrees) { return NO; } @@ -1876,12 +1876,12 @@ public: return ([validSimultaneousGestures containsObject:gestureRecognizer] && [validSimultaneousGestures containsObject:otherGestureRecognizer]); } -- (float)angleBetweenPoints:(CGPoint)west east:(CGPoint)east +- (CLLocationDegrees)angleBetweenPoints:(CGPoint)west east:(CGPoint)east { - float slope = (west.y - east.y) / (west.x - east.x); + CGFloat slope = (west.y - east.y) / (west.x - east.x); - float angle = atan(fabs(slope)); - float degrees = MGLDegreesFromRadians(angle); + CGFloat angle = atan(fabs(slope)); + CLLocationDegrees degrees = MGLDegreesFromRadians(angle); return degrees; } -- cgit v1.2.1