You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
-[MGLMapView selectAnnotation:animated:] does not pan map to fit callout view #3249
When YES is passed into -[MKMapView selectAnnotation:animated:], MKMapView automatically pans so that the entire callout view fits in the viewport. Instead, -[MGLMapView selectAnnotation:animated:]’s animated parameter controls whether the callout view fades in.
A fix for this discrepancy may have to wait until we fix #3154 and #2618.
This could just be a matter of calling -showAnnotation: within -selectAnnotation:animated:. However, we’d have to take care not to reenter -selectAnnotation:animated: and cause infinite recursion.
-showAnnotation: puts the annotation in the center of the viewport, which for point annotations would lead to an undesirable wandering effect as the user selects various annotations. But we could craft a simple method that pans the map only enough to show the point annotation and its callout.
Activity
1ec5 commentedon Sep 6, 2017
Now that #6676 has landed, this is no longer blocked.
1ec5 commentedon Oct 13, 2017
This could just be a matter of calling
-showAnnotation:within-selectAnnotation:animated:. However, we’d have to take care not to reenter-selectAnnotation:animated:and cause infinite recursion.1ec5 commentedon Oct 13, 2017
-showAnnotation:puts the annotation in the center of the viewport, which for point annotations would lead to an undesirable wandering effect as the user selects various annotations. But we could craft a simple method that pans the map only enough to show the point annotation and its callout.1ec5 commentedon Jan 16, 2018
#2600 (comment) illustrates what the fix for this issue might look like inside MGLMapView.
[ios,macos] Selecting offscreen annotation pans map to fit annotation…
julianrex commentedon Mar 26, 2018
Closing since this was addressed in #11442