cubic Bezier
open fun cubicBezier(@NonNull x1: Expression, @NonNull y1: Expression, @NonNull x2: Expression, @NonNull y2: Expression): Expression.Interpolator
open fun cubicBezier(@NonNull x1: Number, @NonNull y1: Number, @NonNull x2: Number, @NonNull y2: Number): Expression.Interpolator
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))
)
)
);
Content copied to clipboard
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>