From 438dfa947d142053d75eb606f1bd6998e8d96c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Thu, 28 Jul 2016 14:52:33 -0700 Subject: [ios] Omit accuracy halo from annotation hit testing (#5816) Fixes #5571. --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e3f259ddf1..1dbf22b4ba 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -6,6 +6,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON * Fixed a crash that occurred when initializing an MGLMapView on iOS 8.1 or below. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791)) * Fixed an issue where pan gestures that originated on view annotations would not pan the underlying map. ([#5813](https://github.com/mapbox/mapbox-gl-native/pull/5813)) +* Fixed an issue that caused the user dot to be selected when tapping an annotation that lies within the user dot’s accuracy circle. ([#5816](https://github.com/mapbox/mapbox-gl-native/pull/5816)) ## 3.3.1 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index b36efe3bd7..4ec3619189 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1394,8 +1394,8 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) CGPoint tapPoint = [singleTap locationInView:self]; - if (self.userLocationVisible - && [self.userLocationAnnotationView.layer.presentationLayer hitTest:tapPoint]) + CALayer *hitLayer = self.userLocationVisible ? [self.userLocationAnnotationView.layer.presentationLayer hitTest:tapPoint] : nil; + if (hitLayer && hitLayer != self.userLocationAnnotationView.haloLayer.presentationLayer) { if ( ! _userLocationAnnotationIsSelected) { -- cgit v1.2.1