state

Note: Not supported on native platforms. See maplibre-native#1698

Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state.

A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature.

When source.promoteId is not provided, features are identified by their id attribute, which must be an integer or a string that can be cast to an integer. When source.promoteId is provided, features are identified by their promoteId property, which may be a number, string, or any primitive data type. Note that state can only be used with layer properties that support data-driven styling.