summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-11-24 12:11:10 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-11-24 12:11:10 -0800
commitf782f5eeb793bc4489a906969ab4774a2befbbb8 (patch)
tree5cb561547697635e81788f659c8ff327fa7185b2
parente87834f15d43981bf9aca3a82d1f31059d0fd8a7 (diff)
downloadqtlocation-mapboxgl-f782f5eeb793bc4489a906969ab4774a2befbbb8.tar.gz
Attach compass gesture recognizer to compass view
Fixes #3099.
-rw-r--r--CHANGELOG.md4
-rw-r--r--platform/ios/MGLMapView.mm3
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2a924b42ac..b1afc699cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,10 @@ Known issues:
## iOS master
+- Fixed an issue preventing the compass from responding to taps after the compass is moved programmatically. ([#3116](https://github.com/mapbox/mapbox-gl-native/pull/3116))
+
+## iOS 3.0.0
+
- If you install this SDK via CocoaPods, CocoaPods version 0.38.0 or above is required. ([#2132](https://github.com/mapbox/mapbox-gl-native/pull/2132))
- The `styleID` property has been removed from MGLMapView. Instead, set the `styleURL` property to an NSURL in the form `mapbox://styles/STYLE_ID`. If you previously set the style ID in Interface Builder’s Attributes inspector, delete the `styleID` entry from the User Defined Runtime Attributes section of the Identity inspector, then set the new “Style URL” inspectable to a value in the form `mapbox://styles/STYLE_ID`. ([#2632](https://github.com/mapbox/mapbox-gl-native/pull/2632))
- Default styles such as Streets are no longer bundled with the SDK; instead, they are loaded at runtime from the style API on mapbox.com. As always, you can use these default styles with any valid access token, and Streets continues to be `MGLMapView`’s initial style. The `bundledStyleURLs` property on `MGLMapView` has been deprecated in favor of several class methods on `MGLStyle` that provide direct access to the default styles. ([#2746](https://github.com/mapbox/mapbox-gl-native/pull/2746))
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index 20e5507c85..db5ef1ee46 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -292,10 +292,11 @@ std::chrono::steady_clock::duration durationInSeconds(float duration)
_compassView.accessibilityLabel = @"Compass";
_compassView.frame = CGRectMake(0, 0, _compassView.image.size.width, _compassView.image.size.height);
_compassView.alpha = 0;
+ _compassView.userInteractionEnabled = YES;
+ [_compassView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleCompassTapGesture:)]];
UIView *container = [[UIView alloc] initWithFrame:CGRectZero];
[container addSubview:_compassView];
container.translatesAutoresizingMaskIntoConstraints = NO;
- [container addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleCompassTapGesture:)]];
[self addSubview:container];
// setup interaction