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 |
|---|---|---|
|
|
number |
Index of the existing point to update. |
|
|
Point | number |
New |
|
|
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.
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);
