-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwiftUI - Control over MapViewAnnotation z index #2135
Comments
Hey, @MaartenDEV that's a nice suggestion actually. May you please elaborate on your specific use case and provide a code snippet with how you try to achieve it as it may help us to better understand the needs. |
Hi @aleksproger, I would expect to be able to set a modifier on a MapViewAnnotation, something like 'weight', 'zIndex' or 'order', where a higher number would mean showing the annotation above annotations with lower numbers. In this example, the yellow circle would appear behind the red circle.
|
Also have a similar use case. Would like to show icons on a map as well as text below the icon. I want the icons to always show up but the text to show up when zoomed in enough for there to be space to show them. If I allowOverlap on the map icon MapViewAnnotations, but not on the text MapViewAnnotations the text never shows up correctly -- even when zooming in. |
New Feature
I'd like to have control over the z Index of each MapViewAnnotation. Currently, only the .selected modifier allows us to control which annotation gets pushed to the front, but that is of no use when dealing with a larger set of annotations where the order matters.
The current iOS docs (non-SwiftUI) tell us that the order of adding annotations determines their z index. Changing the order of MapViewAnnotations in a ForEvery loop does not seem to change their z index.
The text was updated successfully, but these errors were encountered: