points([points])
Class: Polyline.
Description:
Sets an array of new points, or get an array of existing point.
Parameters:
| Name | Type | Description |
|---|---|---|
|
|
Array.<Point> |
An array of new point objects [{x:number, y:number}, ...]. Omit to get current point. |
Returns:
When called without arguments, returns current points; otherwise returns this Polyline for method chaining.
Type: Array.<Point> | Polyline
Examples:
Getting existing points as an Array:
let _points = polyline.points(); // -> array of objects
Setting a new array of points:
polyline.points({
{x:10, y:10},
{x:40, y:10},
{x:60, y:60},
{x:30, y:60},
{x:10, y:10}
});
