Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios] Remove annotation view from container view when annotation removed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boundsj committed May 17, 2017
1 parent 30b9191 commit 9d36092
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3501,6 +3501,7 @@ - (void)removeAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations

annotationView.annotation = nil;
[annotationView removeFromSuperview];
[self.annotationContainerView.annotationViews removeObject:annotationView];

if (annotationTag == _selectedAnnotationTag)
{
Expand Down

0 comments on commit 9d36092

Please sign in to comment.