# new ArcGisPolygon(options)
ArcGis服务
参数:
名称 | 类型 | 属性 | 描述 |
---|---|---|---|
options |
Object | 必选项,构造点对象参数。 |
|
rings |
String |
<optional> |
可选项。构成多边形的点坐标,坐标必须闭合,可有多个矩形。 Example:rings:[[[x1,y1],[x2,y2],[x3,y3],[x1,y1]],[[x4,y4],[x5,y5],[x6,y6],[x4,y4]]] |
spatialReference |
ArcGisSpatialReference |
<optional> |
可选项。多边形的空间坐标系,默认4326。 |
方法
# addRing(points)
根据ringIndex、pointIndex,更新一个多边形对象
参数:
名称 | 类型 | 描述 |
---|---|---|
points |
Array | 必选项,要插入的一组多边形点坐标数组, example:[[x1,y1],[x2,y2],[x3,y3],[x1,y1]]。 |
ArcGisPolygon,多边形对象
# contains(point) → {boolean}
判断多边形是否包含一个点。
参数:
名称 | 类型 | 描述 |
---|---|---|
point |
ArcGisPoint | 必选项,要检测的点对象。 |
多边形是否包含点。
# fromExtent(Extent) → {ArcGisPolygon}
输入一个Extent对象返回一个多边形对象
参数:
名称 | 类型 | 描述 |
---|---|---|
Extent |
ArcGisExtent | 必选项,要输入的ArcGisExtent对象。 |
新的多边形对象。
# getPoint(ringIndex, pointIndex)
根据ringIndex、pointIndex返回点对象
参数:
名称 | 类型 | 描述 |
---|---|---|
ringIndex |
Number | 必选项,要查询的多边形序号。 |
pointIndex |
Number | 必选项,要查询的点序号。 |
ArcGisPoint,点对象
# insertPoint(ringIndex, pointIndex, point)
根据ringIndex、pointIndex,在pointIndex之后插入一个点对象
参数:
名称 | 类型 | 描述 |
---|---|---|
ringIndex |
Number | 必选项,要插入的多边形序号。 |
pointIndex |
Number | 必选项,在第pointIndex之后插入一个点,线标从0开始。 |
point |
Number | 必选项,要要插入的点对象。 |
ArcGisPolygon,多边形对象
# isClockwise(ring) → {boolean}
判断是否是顺时针。
参数:
名称 | 类型 | 描述 |
---|---|---|
ring |
Array | 必选项,[ArcGisPoint]或[[x,y,z]]或[x,y],输入值必须是一组点坐标或对象数组(就是一条线,封闭线就是多边形),不能是多维数组。 |
是否是顺时针。
# removePoint(ringIndex, pointIndex)
根据ringIndex、pointIndex删除一个点,并返回该点对象
参数:
名称 | 类型 | 描述 |
---|---|---|
ringIndex |
Number | 必选项,要删除的点所在的多边形序号。 |
pointIndex |
Number | 必选项,在pointIndex处,删除这个点。 |
ArcGisPoint,点对象
# removeRing(index)
根据index,删除一个多边形点坐标数组
参数:
名称 | 类型 | 描述 |
---|---|---|
index |
Array | 必选项,要删除的多边形序号。 |
[ArcGisPoint],被删除的多边形点对象数组
# setPoint(ringIndex, pointIndex, point)
根据ringIndex、pointIndex,更新一个点对象
参数:
名称 | 类型 | 描述 |
---|---|---|
ringIndex |
Number | 必选项,要更新的点所在的多边形序号。 |
pointIndex |
Number | 必选项,在pointIndex处,更新这个点。 |
point |
ArcGisPoint | 必选项,ArcGisPoint对象或者[x,y]或[x,y,z]数组,要更新的点。 |
ArcGisPolygon,多边形对象