mapbox / mapbox/mapbox-unity-sdk

Change map style runtime sdk3

Open
#1,948 3 comments 0 reactions 1 assignee View on GitHub

@brnkhy is already working on this.

Since Dec 25, 2025.

enhancement
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

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.