public class Polygon extends Geometry
Geometry.GeometryType
Modifier and Type | Method and Description |
---|---|
Polygon |
addRing(Ring ring)
Adds a ring to the Polygon.
|
boolean |
contains(Point point)
Checks on the client if the specified point is inside the polygon.
|
static Polygon |
create(com.google.gwt.core.client.JavaScriptObject json)
Creates a new Polygon object using a JSON object.
|
static Polygon |
create(SpatialReference sr)
Creates a new Polygon object.
|
Extent |
getExtent()
Returns the extent of the polygon.
|
Point |
getPoint(int pathIndex,
int pointIndex)
Returns a point specified by a ring and point in the path.
|
RingGroup |
getRings()
An array of rings.
|
Polygon |
insertPoint(int pathIndex,
int pointIndex,
Point point)
Inserts a new point into a polygon.
|
Point |
removePoint(int ringIndex,
int pointIndex)
Remove a point from the polygon at the given pointIndex within the ring identified by ringIndex.
|
com.google.gwt.core.client.JsArray<Point> |
removeRing(int pathIndex)
Removes a ring from the Polygon.
|
Polygon |
setPoint(int pathIndex,
int pointIndex,
Point point)
Updates a point in a polygon.
|
fromJson, geographicToWebMercator, getExtentForScale, getJson, getJsonType, getLength, getLineIntersection, getScale, getSpatialReference, getType, isClockwise, setSpatialReference, toJson, toMapGeometry, toMapPoint, toScreenGeometry, toScreenPoint, webMercatorToGeographic
public static Polygon create(SpatialReference sr)
sr
- - Spatial reference of the geometry.public static Polygon create(com.google.gwt.core.client.JavaScriptObject json)
json
- - JSON object representing the geometry.public final RingGroup getRings()
public final Polygon addRing(Ring ring)
ring
- public final boolean contains(Point point)
point
- - The location defined by an X- and Y- coordinate in map units.public final Extent getExtent()
public final Point getPoint(int pathIndex, int pointIndex)
pathIndex
- - The index of a ring.pointIndex
- - The index of a point in a ring.public final Polygon insertPoint(int pathIndex, int pointIndex, Point point)
pathIndex
- - Ring index to insert point.pointIndex
- - The index of the inserted point in the ring.point
- - Point to insert into the ring.public final Point removePoint(int ringIndex, int pointIndex)
ringIndex
- - The index of the ring containing the point.pointIndex
- - The index of the point within the ring.public final com.google.gwt.core.client.JsArray<Point> removeRing(int pathIndex)
pathIndex
- - The index of the ring to remove.