mapbox / mapbox/mapbox-maps-ios
"Failed to create LayerType" when using allLayerIdentifiers with custom layer added
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Xcode version: 14.1
- iOS version: any
- Devices affected: any
- Maps SDK Version: 10.9.1
## Observed behavior and steps to reproduce
1. Implement custom layer with `CustomLayerHost`
2. Add custom layer to the chart
3. Get layers identifiers: `let identifiers = mapView.mapboxMap.style.allLayerIdentifiers`
4. Get the `Failed to create LayerType from type custom` error
## Expected behavior
1. You get the list of layers
## Notes / preliminary analysis
1. Custom layers have `custom` type
2. There is no such type in [LayerType.swift](https://github.com/mapbox/mapbox-maps-ios/blob/main/Sources/MapboxMaps/Style/LayerType.swift).
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 Sources/MapboxMaps/Style/LayerType.swift and the mapView.mapboxMap.style.allLayerIdentifiers entry point. Reproduce the issue using CustomLayerHost and a custom layer, then trace how the custom type is handled when identifiers are converted to LayerType. Done means all layer identifiers can be retrieved without the "Failed to create LayerType" error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100