Skip to content

Reset lightsState #2710

@ravenfeld

Description

@ravenfeld

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions