toBool

open fun toBool(@NonNull input: Expression): Expression

Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, false, null, or NaN; otherwise it is true.

Example usage:


CircleLayer circleLayer = new CircleLayer("layer-id", "source-id");
circleLayer.setProperties(
    circleRadius(toBool(get("key-to-value")))
);

Return

expression

Parameters

input

expression input

See also

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