setFeatureState

fun setFeatureState(sourceId: String, sourceLayerId: String? = null, featureId: String, state: Value)

Update the state map of a feature within a style source.

Update entries in the state map of a given feature within a style source. Only entries listed in the \p state map will be updated. An entry in the feature state map that is not listed in \p state will retain its previous value.

Note that updates to feature state are asynchronous, so changes made by this method migth not be immediately visible using getStateFeature().

Parameters

sourceId

Style source identifier.

sourceLayerId

Style source layer identifier (for multi-layer sources such as vector sources).

featureId

Identifier of the feature whose state should be updated.

state

Map of entries to update with their respective new values.