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.
Selecting an off-screen annotation doesn't work #9790
It might make sense to change the behavior so that selecting an off-screen annotation moves the annotation into view, similar to calling -[MGLMapView showAnnotation:]. That is, the camera changes so that the annotation becomes visible at the same time it is selected. This wasn’t possible before #6676, because the annotation would immediately get deselected as soon as the camera moved. But now that we have the ability to keep the callout open, we could have off-screen selection work and solve #3249 at the same time.
It only seems to be the selectedAnnotations property that checks for offscreen, -selectAnnotation:animated: does not. @1ec5 What was the reason for checking offscreen?
Not sure. It could be a remnant of a limitation that has since been fixed. I think we should try to match MapKit’s behavior in this regard if possible.
Activity
settl commentedon Sep 3, 2017
+1, I'm having the same issue. Do you have any plans to work on this?
friedbunny commentedon Sep 5, 2017
Though I don’t recall the reasons (@boundjs and @1ec5 would know), not selecting off-screen annotations is intentional and documented:
1ec5 commentedon Sep 6, 2017
It might make sense to change the behavior so that selecting an off-screen annotation moves the annotation into view, similar to calling
-[MGLMapView showAnnotation:]. That is, the camera changes so that the annotation becomes visible at the same time it is selected. This wasn’t possible before #6676, because the annotation would immediately get deselected as soon as the camera moved. But now that we have the ability to keep the callout open, we could have off-screen selection work and solve #3249 at the same time.julianrex commentedon Feb 16, 2018
It only seems to be the
selectedAnnotationsproperty that checks for offscreen,-selectAnnotation:animated:does not. @1ec5 What was the reason for checking offscreen?1ec5 commentedon Feb 20, 2018
Not sure. It could be a remnant of a limitation that has since been fixed. I think we should try to match MapKit’s behavior in this regard if possible.
[ios] Removes check for on-screen in setSelectedAnnotations (#9790). …
[ios,macos] Removes check for on-screen in setSelectedAnnotations (#9790
[ios,macos] Removes check for on-screen in setSelectedAnnotations (#9790
[ios,macos] Selecting offscreen annotation pans map to fit annotation…