coalesce

Evaluates each expression in turn until the first non-null value is obtained, and returns that value.

Example usage:


SymbolLayer symbolLayer = new SymbolLayer("layer-id", "source-id");
symbolLayer.setProperties(
    textColor(
        coalesce(
            get("keyToNullValue"),
            get("keyToNonNullValue")
        )
    )
);

Return

expression

Parameters

input

expression input

See also

<a href="https://maplibre.org/maplibre-style-spec/expressions/#coalesce">Style specification</a>