Description
An array of rings where each ring is an array points. The first and last points of a ring must be the same.
Class hierarchy
esri.geometry.Geometry
|_ esri.geometry.Polygon
Constructor
Properties
| rings |
Number[][][]
|
An array of rings. Each ring is made up of three or more points. |
Methods
Constructor Detail
esri.geometry.Polygon(spatialReference)
Creates a new Polygon object.
Parameters:
esri.geometry.Polygon(json)
Creates a new Polygon object using a JSON object.
Parameters:
|
<Object>
json |
Required |
JSON object representing the geometry.
|
Properties Detail
An array of rings. Each ring is made up of three or more points.
Methods Detail
addRing(points or ring or pointJson)
Adds a ring to the Polygon. The ring can be one of the following: an array of numbers, an array of points, or a JSON object. When added the index of the ring is incremented by one.
The return value of Polygon was added at v1.4.
Input Parameters:
|
<Point[]> points |
Required |
An array of ESRI points to create a ring. |
|
<Number[][]> ring |
Required |
An array of x,y coordinate pairs to create a ring. |
|
<Object> pointJson |
Required |
A JSON object representing a ring. |
Checks on the client if the specified point is inside the polygon. A point on the polygon line is considered in.
Return value: Boolean
Input Parameters:
|
<Point> point |
Required |
The location defined by an X- and Y- coordinate in map units. |
Returns the extent of the polygon.
getPoint(ringIndex, pointIndex)
Returns a point specified by a ring and point in the path.
Input Parameters:
|
<Number> ringIndex |
Required |
The index of a ring. |
|
<Number> pointIndex |
Required |
The index of a point in a ring. |
insertPoint(ringIndex, pointIndex, point)
Inserts a new point into a polygon. (As of v1.4)
Input Parameters:
|
<Number> ringIndex |
Required |
Ring index to insert point. |
|
<Number> pointIndex |
Required |
The index of the inserted point in the ring. |
|
<Point> point |
Required |
Point to insert into the ring. |
Removes a ring from the Polygon. The index specifies which ring to remove.
Input Parameters:
|
<Number> ringIndex |
Required |
The index of the ring to remove. |
setPoint(ringIndex, pointIndex, point)
Updates a point in a polygon. (As of v1.4)
Input Parameters:
|
<Number> ringIndex |
Required |
Ring index for updated point. |
|
<Number> pointIndex |
Required |
The index of the updated point in the ring. |
|
<Point> point |
Required |
Point to update in the ring. |