mapbox / mapbox/mapbox-maps-ios

onStyleLoaded not called

Open
#2,406 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.