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 14:05:29 -0800
commit8ba6f80c1b0d02f09ab787af7b145345b0f0244d (patch)
treebc62ef21d883bb955518ad646f4c333ecb7c6674
parent6d4e86f41db54fa2830f726b990236790ea1c525 (diff)
downloadqtlocation-mapboxgl-8ba6f80c1b0d02f09ab787af7b145345b0f0244d.tar.gz
Attach compass gesture recognizer to compass view
Fixes #3099.
-rw-r--r--CHANGELOG.md2
-rw-r--r--platform/ios/MGLMapView.mm3
2 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 712d3116ee..c3fb7efba0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,8 @@ 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))
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index 646e02cc7b..3a0aa6d4b3 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