From 9d36092f50ea082653ea6abd1fc5e5d63aca40f2 Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Wed, 17 May 2017 10:34:17 -0700 Subject: [PATCH] [ios] Remove annotation view from container view when annotation removed The annotation container view keeps an array of annotation views that is separate from the array of subviews that is a property of the UIView parent class. This removes an annotation view from that container view array when the associated annotation is removed. This avoids issue related to previously removed annotation views continuing to be involved in map view logic around annotation view selection due to taps. --- platform/ios/src/MGLMapView.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index a4c9f5194c4..ea5276856c1 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3501,6 +3501,7 @@ - (void)removeAnnotations:(NS_ARRAY_OF(id ) *)annotations annotationView.annotation = nil; [annotationView removeFromSuperview]; + [self.annotationContainerView.annotationViews removeObject:annotationView]; if (annotationTag == _selectedAnnotationTag) {