summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLMapView.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/src/MGLMapView.mm')
-rw-r--r--platform/ios/src/MGLMapView.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 31058c3de2..c4f6cd39a3 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -2657,7 +2657,8 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
// Filter out any annotation whose image is unselectable or for which
// hit testing fails.
- std::remove_if(nearbyAnnotations.begin(), nearbyAnnotations.end(), [&](const MGLAnnotationTag annotationTag)
+ auto end = std::remove_if(nearbyAnnotations.begin(), nearbyAnnotations.end(),
+ [&](const MGLAnnotationTag annotationTag)
{
id <MGLAnnotation> annotation = [self annotationWithTag:annotationTag];
NSAssert(annotation, @"Unknown annotation found nearby tap");
@@ -2674,6 +2675,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
centeredAtCoordinate:annotation.coordinate];
return !!!CGRectIntersectsRect(annotationRect, hitRect);
});
+ nearbyAnnotations.resize(std::distance(nearbyAnnotations.begin(), end));
}
MGLAnnotationTag hitAnnotationTag = MGLAnnotationTagNotFound;