cubicBezier

Interpolates using the cubic bezier curve defined by the given control points.

Example usage:


FillLayer fillLayer = new FillLayer("layer-id", "source-id");
fillLayer.setProperties(
    fillColor(
      interpolate(
        cubicBezier(0.42f, 0.0f, 1.0f, 1.0f), zoom(),
        stop(1.0f, color(Color.RED)),
        stop(5.0f, color(Color.BLUE)),
        stop(10.0f, color(Color.GREEN))
      )
    )
);

Return

expression

Parameters

x1

x value of the first point of a cubic bezier, ranges from 0 to 1

y1

y value of the first point of a cubic bezier, ranges from 0 to 1

x2

x value of the second point of a cubic bezier, ranges from 0 to 1

y2

y value fo the second point of a cubic bezier, ranges from 0 to 1

See also

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