point(index, point_or_x, [y])

Class: Polyline.

Description:

Sets or gets a point of the Polyline {x:number, y:number} at a specified index.

Parameters:

Name Type Description

index

number

Index of the existing point to update.

point_or_x

Point | number

New Point object or X coordinate of the new point.

[y]

number

Y coordinate of the new point.

Returns:

When getting a point, returns a point object or throws and Error. When setting the point, returns this Polyline or throws an Error.

Type: Point | Polyline

Examples:

Updating a point at index 3:

polyline.point(3, 50, 80); // x = 50, y = 80

// or...

polyline.point(3, {x:50, y:80});

Getting a point at index 3:

let p = polyline.point(3);