mapbox / mapbox/mapbox-maps-ios
SwiftUI - Control over MapViewAnnotation z index
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
## 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing SwiftUI MapViewAnnotation and the existing .selected modifier, then compare the behavior with the current iOS annotation-order documentation. Done means callers can control each annotation's z index independently, including when annotations are generated in a ForEach loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100