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

[ios] Always show annotation view even when view reuse is not used #6485

Merged
merged 2 commits into from
Sep 27, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4572,6 +4572,10 @@ - (void)updateAnnotationViews
annotationView.mapView = self;
annotationView.center = [self convertCoordinate:annotationContext.annotation.coordinate toPointToView:self];
annotationContext.annotationView = annotationView;

if (!annotationView.superview) {
[self.annotationContainerView insertSubview:annotationView atIndex:0];
}
}
else
{
Expand All @@ -4581,7 +4585,7 @@ - (void)updateAnnotationViews
}

bool annotationViewIsVisible = CGRectContainsRect(viewPort, annotationView.frame);
if (!annotationViewIsVisible)
if (!annotationViewIsVisible && annotationContext.viewReuseIdentifier)
{
[self enqueueAnnotationViewForAnnotationContext:annotationContext];
}
Expand Down