round

open fun round(expression: Expression): Expression

Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example `[\"round\", -1.5]` evaluates to -2.

Example usage:


CircleLayer circleLayer = new CircleLayer("layer-id", "source-id");
circleLayer.setProperties(
    circleRadius(round(pi()))
);

Return

expression

Parameters

expression

number expression to round

See also

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

open fun round(@NonNull number: Number): Expression

Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example `[\"round\", -1.5]` evaluates to -2.

Example usage:


CircleLayer circleLayer = new CircleLayer("layer-id", "source-id");
circleLayer.setProperties(
    circleRadius(round(3.14159265359f))
);

Return

expression

Parameters

number

number to round

See also

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