ArcGisPolygon Class

ArcGis.ArcGisPolygon(options)

Fx构造函数

# 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。

作者:
  • 基础平台-杨琨

查看源代码 service/ArcGis/Polygon.js, line 9

方法

# addRing(points)

根据ringIndex、pointIndex,更新一个多边形对象

参数:
名称 类型 描述
points Array

必选项,要插入的一组多边形点坐标数组, example:[[x1,y1],[x2,y2],[x3,y3],[x1,y1]]。

查看源代码 service/ArcGis/Polygon.js, line 107

ArcGisPolygon,多边形对象

# contains(point) → {boolean}

判断多边形是否包含一个点。

参数:
名称 类型 描述
point ArcGisPoint

必选项,要检测的点对象。

查看源代码 service/ArcGis/Polygon.js, line 163

多边形是否包含点。

boolean

# fromExtent(Extent) → {ArcGisPolygon}

输入一个Extent对象返回一个多边形对象

参数:
名称 类型 描述
Extent ArcGisExtent

必选项,要输入的ArcGisExtent对象。

查看源代码 service/ArcGis/Polygon.js, line 202

新的多边形对象。

ArcGisPolygon

# getPoint(ringIndex, pointIndex)

根据ringIndex、pointIndex返回点对象

参数:
名称 类型 描述
ringIndex Number

必选项,要查询的多边形序号。

pointIndex Number

必选项,要查询的点序号。

查看源代码 service/ArcGis/Polygon.js, line 36

ArcGisPoint,点对象

# insertPoint(ringIndex, pointIndex, point)

根据ringIndex、pointIndex,在pointIndex之后插入一个点对象

参数:
名称 类型 描述
ringIndex Number

必选项,要插入的多边形序号。

pointIndex Number

必选项,在第pointIndex之后插入一个点,线标从0开始。

point Number

必选项,要要插入的点对象。

查看源代码 service/ArcGis/Polygon.js, line 49

ArcGisPolygon,多边形对象

# isClockwise(ring) → {boolean}

判断是否是顺时针。

参数:
名称 类型 描述
ring Array

必选项,[ArcGisPoint]或[[x,y,z]]或[x,y],输入值必须是一组点坐标或对象数组(就是一条线,封闭线就是多边形),不能是多维数组。

查看源代码 service/ArcGis/Polygon.js, line 139

是否是顺时针。

boolean

# removePoint(ringIndex, pointIndex)

根据ringIndex、pointIndex删除一个点,并返回该点对象

参数:
名称 类型 描述
ringIndex Number

必选项,要删除的点所在的多边形序号。

pointIndex Number

必选项,在pointIndex处,删除这个点。

查看源代码 service/ArcGis/Polygon.js, line 68

ArcGisPoint,点对象

# removeRing(index)

根据index,删除一个多边形点坐标数组

参数:
名称 类型 描述
index Array

必选项,要删除的多边形序号。

查看源代码 service/ArcGis/Polygon.js, line 123

[ArcGisPoint],被删除的多边形点对象数组

# setPoint(ringIndex, pointIndex, point)

根据ringIndex、pointIndex,更新一个点对象

参数:
名称 类型 描述
ringIndex Number

必选项,要更新的点所在的多边形序号。

pointIndex Number

必选项,在pointIndex处,更新这个点。

point ArcGisPoint

必选项,ArcGisPoint对象或者[x,y]或[x,y,z]数组,要更新的点。

查看源代码 service/ArcGis/Polygon.js, line 82

ArcGisPolygon,多边形对象

# toGeometryJSON()

将点坐标转换为Json对象

查看源代码 service/ArcGis/Polygon.js, line 179

String