mapbox / mapbox/mapbox-maps-ios
onStyleLoaded not called
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Xcode version: 26.1.1
- iOS version: 26.1
- Devices affected:
- Maps SDK Version: 11.19.0
## Observed behavior and steps to reproduce
The map sometimes doesn't invoke the `onStyleLoaded` or `onMapLoaded` lifecycle callbacks.
## Expected behavior
The map should always invoke the callbacks
## Notes / preliminary analysis
This issue appears to occur when the view re-renders due to a state change moments after the map is initialised.
Attached is a minimal sample project that exhibits the issue.
## Additional links and references
[MapboxOnStyleLoadedNotCalled.zip](https://github.com/user-attachments/files/25772079/MapboxOnStyleLoadedNotCalled.zip)
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 the attached MapboxOnStyleLoadedNotCalled.zip minimal sample project and reproduce the issue on the listed Xcode, iOS, and Maps SDK versions. Trace the map initialization and the state change that causes the view to re-render; done means onStyleLoaded and onMapLoaded are consistently invoked after initialization and re-rendering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100