mapbox / mapbox/mapbox-unity-sdk
Change map style runtime sdk3
@brnkhy is already working on this.
Since Dec 25, 2025.
- Dominant language
- C#
- Stars
- 784
- Forks
- 231
- PR merge metrics
- No merged PRs in 30d
Description
What's the propery way to change map style in runtime e.g. from Mapbox Light to Mapbox Dark in sdk3?
StaticApiLayerModuleScript.cs have `StaticLayerModuleSettings` Settings that contain `public ImagerySourceType SourceType;`. Changing it when editor is not playing works once game is started. The issue is that changing it in inspector during runtime doesn't do a thing, same while changed in code.
I know this class has method `public override ILayerModule ConstructModule(MapService service, IMapInformation mapInformation, UnityContext unityContext)`. This is invoked on map initialization. I don't know how to "reinitialize" map during runtime once ImagerySourceType is changed.
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.
Assessment
This issue has not been assessed yet.