ArcGisPolyline Class

ArcGis.ArcGisPolyline(options)

Fx构造函数

# new ArcGisPolyline(options)

ArcGis服务

参数:
名称 类型 属性 描述
options Object

必选项,构造点对象参数。

paths String <optional>

可选项。构成线的点坐标,可有多条。 Example: [[[x1,y1],[x2,y2],[x3,y3]],[[x4,y4],[x5,y5],[x6,y6]]]

spatialReference ArcGisSpatialReference <optional>

可选项。多边形的空间坐标系,默认4326。

作者:
  • 基础平台-杨琨

查看源代码 service/ArcGis/Polyline.js, line 6

方法

# addRing(points)

传入坐标数组或者[ArcGisPoint]数组,新增一条线

参数:
名称 类型 描述
points Array

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

查看源代码 service/ArcGis/Polyline.js, line 77

ArcGisPolyline,线对象

# getPoint(pathIndex, pointIndex)

根据pathIndex和pointIndex返回ArcGisPoint对象

参数:
名称 类型 描述
pathIndex Number

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

pointIndex Number

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

查看源代码 service/ArcGis/Polyline.js, line 25

ArcGisPoint,点对象

# insertPoint(pathIndex, pointIndex, point)

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

参数:
名称 类型 描述
pathIndex Number

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

pointIndex Number

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

point Number

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

查看源代码 service/ArcGis/Polyline.js, line 109

ArcGisPolyline,线对象

# removePoint(pathIndex, pointIndex)

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

参数:
名称 类型 描述
pathIndex Number

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

pointIndex Number

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

查看源代码 service/ArcGis/Polyline.js, line 38

ArcGisPoint,点对象

# removeRing(index)

根据index删除一条线,并返回点对象数组

参数:
名称 类型 描述
index Array

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

查看源代码 service/ArcGis/Polyline.js, line 93

[ArcGisPoint],被删除的线的点对象数组

# setPoint(pathIndex, pointIndex, point)

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

参数:
名称 类型 描述
pathIndex Number

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

pointIndex Number

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

point ArcGisPoint

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

查看源代码 service/ArcGis/Polyline.js, line 52

ArcGisPolyline,线对象

# toGeometryJSON()

将点坐标转换为Json对象

查看源代码 service/ArcGis/Polyline.js, line 129

String