Description
An array of paths where each path is an array of points.
Class hierarchy
esri.geometry.Geometry
|_ esri.geometry.Polyline
Constructor
Properties
| paths |
Number[][][]
|
An array of paths. Each path is made up of an array of two or more points. |
Methods
Constructor Detail
esri.geometry.Polyline(spatialReference)
Creates a new Polyline object.
Parameters:
esri.geometry.Polyline(json)
Creates a new Polyline object using a JSON object.
Parameters:
|
<Object>
json |
Required |
JSON object representing the geometry.
|
Properties Detail
An array of paths. Each path is made up of an array of two or more points.
Methods Detail
addPath(points or path or pointJson)
Adds a path to the Polyline. The path can be one of the following: an array of numbers, an array of points, or a JSON object. When added the index of the path is incremented by one.
The return value of Polyline was added at v1.4.
Input Parameters:
|
<Point[]> points |
Required |
An array of ESRI points to create a path. |
|
<Number[][]> path |
Required |
An array of x,y coordinate pairs to create a path. |
|
<Object> pointJson |
Required |
A JSON object representing a path. |
Code snippets:
polyline.addPath([new esri.geometry.Point(10,10), new esri.geometry.Point(20,20), new esri.geometry.Point(30,30)]);
Returns the extent of the Polyline.
getPoint(pathIndex, pointIndex)
Returns a point specified by a path and point in the path.
Input Parameters:
|
<Number> pathIndex |
Required |
The index of a path in a polyline. |
|
<Number> pointIndex |
Required |
The index of a point in a path. |
insertPoint(pathIndex, pointIndex, point)
Inserts a new point into a polyline. (As of v1.4)
Input Parameters:
|
<Number> pathIndex |
Required |
Path index to insert point. |
|
<Number> pointIndex |
Required |
The index of the inserted point in the path. |
|
<Point> point |
Required |
Point to insert into the path. |
Removes a path from the Polyline. The index specifies which path to remove.
Input Parameters:
|
<Number> pathIndex |
Required |
The index of a path to remove. |
setPoint(pathIndex, pointIndex, point)
Updates a point in a polyline. (As of v1.4)
Input Parameters:
|
<Number> pathIndex |
Required |
Path index for updated point. |
|
<Number> pointIndex |
Required |
The index of the updated point in the path. |
|
<Point> point |
Required |
Point to update in the path. |