getFeatureState

fun getFeatureState(sourceId: String, sourceLayerId: String? = null, featureId: String, callback: QueryFeatureStateCallback): Cancelable

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 cancelable object that could be used to cancel the pending query.

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.

callback

The query feature state callback called when the query completes.


Gets the state map for given FeaturesetFeature.

Return

A Cancelable object that could be used to cancel the pending query.

Parameters

featuresetFeature

typed FeaturesetFeature obtained from MapInteraction or needed overload of queryRenderedFeatures.

callback

The FeatureStateCallback called when the query completes.


Gets the state map of a feature from a featureset asynchronously.

This API should be used with caution as Feature defined by the FeaturesetFeatureId.featureId only might not be compatible with provided FeaturesetFeatureId.featureNamespace and descriptor and thus API behaviour might be unexpected. It is safer to use overloaded getFeatureState taking FeaturesetFeature.

Return

A Cancelable object that could be used to cancel the pending query.

Parameters

descriptor

TypedFeaturesetDescriptor object representing either a featureset or a single layer.

id

identifier holding feature id and feature namespace.

callback

The FeatureStateCallback called when the query completes.