From b3d4a5cbf82913e9d6f350f5e623bbcf185a938a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 9 May 2016 13:13:31 -0700 Subject: [PATCH] [ios, osx] Find nearby annotation when not persisting query Fixed an issue that made the osxapp context menu only apply to the right-clicked pin after first selecting the pin. This also happened to be a latent bug in the iOS implementation. --- platform/ios/src/MGLMapView.mm | 4 ++-- platform/osx/src/MGLMapView.mm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index e12e54d67..184a3fd5d 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3142,9 +3142,9 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) } // Choose the first nearby annotation. - if (_annotationsNearbyLastTap.size()) + if (nearbyAnnotations.size()) { - hitAnnotationTag = _annotationsNearbyLastTap.front(); + hitAnnotationTag = nearbyAnnotations.front(); } } } diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm index d1356c6b4..382d9f8ba 100644 --- a/platform/osx/src/MGLMapView.mm +++ b/platform/osx/src/MGLMapView.mm @@ -1895,8 +1895,8 @@ public: } // Choose the first nearby annotation. - if (_annotationsNearbyLastClick.size()) { - hitAnnotationTag = _annotationsNearbyLastClick.front(); + if (nearbyAnnotations.size()) { + hitAnnotationTag = nearbyAnnotations.front(); } } }