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

Commit 953c343

Browse files
committed
[ios] Bring annotation view to front when selected
Fixes #991.
1 parent 6f1622b commit 953c343

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

platform/ios/src/MGLMapView.mm

+5-2
Original file line numberDiff line numberDiff line change
@@ -3395,10 +3395,13 @@ - (void)selectAnnotation:(id <MGLAnnotation>)annotation animated:(BOOL)animated
33953395
{
33963396
MGLAnnotationContext &annotationContext = _annotationContextsByAnnotationTag.at(annotationTag);
33973397

3398-
if (annotationContext.annotationView)
3398+
MGLAnnotationView *annotationView = annotationContext.annotationView;
3399+
if (annotationView)
33993400
{
34003401
// Annotations represented by views use the view frame as the positioning rect.
3401-
positioningRect = annotationContext.annotationView.frame;
3402+
positioningRect = annotationView.frame;
3403+
3404+
[annotationView.superview bringSubviewToFront:annotationView];
34023405
}
34033406
}
34043407

0 commit comments

Comments
 (0)