set Feature State
Updates the state object of a feature within a style source.
Update entries in the state
object of a given feature within a style source. Only properties of the state
object will be updated. A property in the feature state
object that is not listed in state
will retain its previous value. The properties must be paint properties, layout properties are not supported.
Note that updates to feature state
are asynchronous, so changes made by this method might not be immediately visible using getStateFeature
. And the corresponding source needs to be in use to ensure the feature data it contains can be successfully updated.
Return
A cancelable
object that could be used to cancel the pending operation.
Parameters
The style source identifier.
The style source layer identifier (for multi-layer sources such as vector sources).
The feature identifier of the feature whose state should be updated.
The state
object with properties to update with their respective new values.
The feature state operation callback
called when the operation completes or ends.
Sets the state map for given interactiveFeature coming from an interaction callback asynchronously.
Return
A Cancelable object that could be used to cancel the pending query.
Parameters
the interactive feature coming from an interaction callback.
describes the new state of the map for given interactiveFeature.
The optional QueryFeatureStateCallback called when the query completes.
Sets the state map of a feature within a style source asynchronously.
Return
A Cancelable object that could be used to cancel the pending query.
Parameters
FeaturesetHolder object representing either a featureset or a single layer.
The feature identifier of the feature whose state should be queried.
Optional feature namespace. Defaults to NULL. Namespace represents the feature namespace defined by the Selector within a featureset to which this feature belongs. If the underlying source is the same for multiple selectors within a featureset, the same featureNamespace should be used across those selectors. Defining a featureNamespace value for the Selector is recommended, especially when multiple selectors exist in a featureset, as it can enhance the efficiency of feature operations.
describes the new state of the map for given feature.
The optional QueryFeatureStateCallback called when the query completes.