removeFeatureState

fun removeFeatureState(sourceId: String, sourceLayerId: String? = null, featureId: String, stateKey: String? = null, callback: FeatureStateOperationCallback): Cancelable

Removes entries from a feature state object.

Remove a specified property or all property from a feature's state object, depending on the value of stateKey.

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

Return

A cancelable object that could be used to cancel the pending operation.

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 removed.

stateKey

The key of the property to remove. If null, all feature's state object properties are removed.

callback

The feature state operation callback called when the operation completes or ends.


fun <FS : FeatureState, FSK : FeatureStateKey<FS>> removeFeatureState(featuresetFeature: FeaturesetFeature<FS>, stateKey: FSK? = null, callback: FeatureStateOperationCallback = FeatureStateOperationCallback { }): Cancelable

Removes entries from a feature state based on featuresetFeature coming from an interaction callback.

Removes a specified property or all property from a feature's state object, depending on the value of stateKey.

Note that updates to feature state are asynchronous, so changes made by this method might not be immediately visible using getFeatureState.

Return

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

Parameters

featuresetFeature

The featureset feature coming from an interaction callback.

stateKey

The key of the property to remove. If null, all feature's state object properties are removed.

callback

The FeatureStateOperationCallback called when the operation completes or ends.


fun <FS : FeatureState, FSK : FeatureStateKey<FS>> removeFeatureState(descriptor: TypedFeaturesetDescriptor<FS, *>, id: FeaturesetFeatureId, stateKey: FSK? = null, callback: FeatureStateOperationCallback = FeatureStateOperationCallback { }): Cancelable

Removes entries from a feature state object.

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.

Removes a specified property or all property from a feature's state object, depending on the value of stateKey.

Note that updates to feature state are asynchronous, so changes made by this method might not be immediately visible using getFeatureState.

Return

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

Parameters

descriptor

TypedFeaturesetDescriptor object representing either a featureset or a single layer.

id

identifier holding feature id and feature namespace.

stateKey

The key of the property to remove. If null, all feature's state object properties are removed.

callback

The FeatureStateOperationCallback called when the operation completes or ends.