Defines a connected sequence of line segments created as a single object.
A polyline is a line consisting of one or more line segments joined end to end. Polylines, unlike polygons, are not necessarily closed.
new Polyline(
points?):Polyline
Creates a polyline from points.
Copies of the provided points are stored in the polyline.
Point[] = []
Polyline points.
Polyline
readonlypoints:Point[]
Points composing the polyline.
get id():
bigint
Returns the unique identifier of the object.
bigint
get numberOfPoints():
number
Returns the number of points in the polyline.
Use Polyline.points and points.length instead.
number
addPoint(
point):void
Adds a copy of the point to the end of the polyline.
Point to copy and add.
void
Use Polyline.points and points.push(point.clone()) instead.
addPoints(
points):void
Adds copies of the points to the end of the polyline.
Point[]
Points to copy and add.
void
Use Polyline.points and points.push(...addedPoints.map((point) => point.clone())) instead.
point(
index):Point
Returns the point at position index in the polyline.
Throws a RangeError if index is not in the range [0, numberOfPoints - 1].
number
Point index.
Use Polyline.points and points[index] instead.