getFeatureState

suspend fun MapboxMap.getFeatureState(sourceId: String, sourceLayerId: String? = null, featureId: String): Expected<String, Value>

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

Note that updates to feature state are asynchronous, so changes made by other methods might not be immediately visible.

Return

a feature state value or a string describing an error.

Parameters

sourceId

The style source identifier.

sourceLayerId

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

featureId

The feature identifier of the feature whose state should be queried.