mapbox / mapbox/mapbox-maps-android
Reset lightsState
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
## New Feature
Hello @JvmField, why is `internal val INITIAL: LightsState = LightsState(MapboxLight.NoOp)` internal?
I think I need it to reset my style when my user disables 3D.
```
val styleState = rememberStyleState {
projection = Projection.MERCATOR
if (mapProperties.terrain3dEnable) {
terrainState = customTerrainState
lightsState = LightsState.DEFAULT
atmosphereState = currentAtmosphereState
} else {
terrainState = TerrainState.DISABLED
lightsState = LightsState.DEFAULT
atmosphereState = AtmosphereState()
}
}
```
I'm thinking of doing it this way, but then I don't see how to reset the light to INITIAL.
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 by tracing LightsState.DEFAULT and the internal INITIAL value based on MapboxLight.NoOp, then inspect how the styleState block applies lightsState when terrain3dEnable changes. Done means a user can disable 3D and reliably reset the lights to the initial state without relying on inaccessible API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100