类名 ArcGisPolyline

# new ArcGisPolyline(options)

ArcGis服务

参数

名称 类型 描述
options Object

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

paths String

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

spatialReference ArcGisSpatialReference

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

作者:
  • 基础平台-杨琨

方法

方法概述

名称 返回值类型 描述
addRing

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

getPoint

根据pathIndex和pointIndex返回ArcGisPoint对象

insertPoint

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

removePoint

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

removeRing

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

setPoint

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

toGeometryJSON

将点坐标转换为Json对象

方法详情

# addRing(points)

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

参数

名称 类型 描述
points Array

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

ArcGisPolyline,线对象

# getPoint(pathIndex, pointIndex)

根据pathIndex和pointIndex返回ArcGisPoint对象

参数

名称 类型 描述
pathIndex Number

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

pointIndex Number

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

ArcGisPoint,点对象

# insertPoint(pathIndex, pointIndex, point)

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

参数

名称 类型 描述
pathIndex Number

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

pointIndex Number

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

point Number

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

ArcGisPolyline,线对象

# removePoint(pathIndex, pointIndex)

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

参数

名称 类型 描述
pathIndex Number

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

pointIndex Number

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

ArcGisPoint,点对象

# removeRing(index)

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

参数

名称 类型 描述
index Array

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

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

# setPoint(pathIndex, pointIndex, point)

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

参数

名称 类型 描述
pathIndex Number

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

pointIndex Number

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

point ArcGisPoint

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

ArcGisPolyline,线对象

# toGeometryJSON()

将点坐标转换为Json对象

String