globalState

open fun globalState(@NonNull property: String): Expression(source)

Gets a property value from the map's global state. Returns null if the requested property is not present in the global state.

The global state can be set with setGlobalStateProperty and defaults can be defined with the style's root state property.

Example usage:


CircleLayer circleLayer = new CircleLayer("layer-id", "source-id");
circleLayer.setFilter(
    eq(get("charger-type"), globalState("chargerType"))
);

Return

expression

Parameters

property

the name of the global state property

See also