mapbox / mapbox/mapbox-maps-ios
Position of layers in PointAnnotationManager and Cluster code does not affect the order on the screen
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Xcode version: 15.0.0
- iOS version: 17.0(simulator), 17.4.1(real device)
- Devices affected: all
- Maps SDK Version: 11.3.0
## Observed behavior and steps to reproduce
The order in which the PointAnnotationManager layers are set has no effect on their display on the screen.
What matters is the order in which they are added to the MapBox.
Cluster from one PointAnnotationManager is always below another PointAnnotationManager.
Layers ids are pointed on screenshots.
`PointManager` is one `PointAnnotationManager`
`mapbox-iOS-cluster-circle-layer-manager-PointManager` and `mapbox-iOS-cluster-text-layer-manager-PointManager` are cluster layers from `PointManager`
`UserPinAnnotation` is another `PointAnnotationManager` without cluster options.
mapView.mapboxMap.allLayerIdentifiers output:
▿ 4 elements
▿ 0 : LayerInfo
- id : "UserPinAnnotation"
▿ type : LayerType
- rawValue : "symbol"
▿ 1 : LayerInfo
- id : "PointManager"
▿ type : LayerType
- rawValue : "symbol"
▿ 2 : LayerInfo
- id : "mapbox-iOS-cluster-circle-layer-manager-PointManager"
▿ type : LayerType
- rawValue : "circle"
▿ 3 : LayerInfo
- id : "mapbox-iOS-cluster-text-layer-manager-PointManager"
▿ type : LayerType
- rawValue : "symbol"
-

## Expected behavior
Cluster layers should be above `UserPinAnnotation` on the screen
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 with PointAnnotationManager and its Cluster layer ordering, using the reported allLayerIdentifiers output to trace how UserPinAnnotation and the cluster layers are placed. Done means cluster layers render above UserPinAnnotation regardless of the order in which the managers are added to the map.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100