Class: SketchExtentDrawTool

SketchExtentDrawTool

new SketchExtentDrawTool(options)

sketchEditor/base/drawTools/SketchExtentDrawTool.js, line 8

矩形绘图工具类

Name Type Description
options Object

构造参数

Name Type Description
view MapView | SceneView 可选

地图视图对象

layer GraphicsLayer 可选

草图图层管对象

sketchStyle SketchStyle 可选

草图符号

Extends

Members

arcTypeNumber

弧线类型

editOptionObject

草图选中编辑配置项

elevationInfoSketchStyle

图形高程模式参数

extensionOptionsObject

草图编辑的扩展属性,可以通过该属性传入草图编辑额外需要的参数

草图图层

sketchStageSketchStage

草图绘图形集合

sketchStyleSketchStyle

草图符号

typeString

草图工具类型名

undoRedoManagerString

草图撤销回退管理器

地图视图

Methods

addFeature(points, sketchStyle)

sketchEditor/base/drawTools/SketchExtentDrawTool.js, line 190

添加图形

Name Type Description
points Array

生成面的点地理坐标集

sketchStyle SketchStyle

面的符号样式

inherited addVertex(point, index)

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 914

当前草图图形中插入新的顶点

Name Type Description
point Point

新增/插入顶点

index Number

新增点的索引值,索引值从0开始

drawFeature()

sketchEditor/base/drawTools/SketchExtentDrawTool.js, line 48

鼠标绘制图形:鼠标单击绘制区的一个顶点;鼠标移动,区图形随鼠标位置变动;鼠标双击,完成区图形绘制。

inherited getDistanceByPixel(pixel){Number}

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 934

根据像素单位获取距离

Name Type Description
pixel Number

编辑状态码

Returns:
Type Description
Number 距离

inherited getMidScaleCoordinates(coordinates, direction, extent, startPoint, movePoint, oriCoordinates){Number}

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 1079

获取图形通过四个中点缩放后的坐标

Name Type Description
coordinates Array

坐标数组

direction String

方向

extent Extent

图形extent范围

startPoint Point

移动前的点

movePoint Point

移动后的点

oriCoordinates Point

图形原始坐标

Returns:
Type Description
Number 缩放后的坐标

inherited getPanCoordinates(coordinates, deltaX, deltaY, pointType, extent){Number}

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 951

获取平移后的坐标

Name Type Description
coordinates Array

坐标数组

deltaX Number

x轴偏移量

deltaY Number

y轴偏移量

pointType Number

点属性类型

extent Number

点所在范围

Returns:
Type Description
Number 平移后的坐标

inherited getScaleCoordinates(coordinates, direction, extent, startPoint, movePoint, oriCoordinates){Number}

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 991

获取图形通过四个顶点缩放后的坐标

Name Type Description
coordinates Array

坐标数组

direction String

方向

extent Extent

图形extent范围

startPoint Point

移动前的点

movePoint Point

移动后的点

oriCoordinates Point

图形原始坐标

Returns:
Type Description
Number 缩放后的坐标

inherited removeDrawTool()

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 884

清除草图绘制工具

inherited removeVertex(index)

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 927

移除草图图形的某个顶点

Name Type Description
index Number

需移除的顶点的索引值,索引值从0开始

selectFeature(feature)

sketchEditor/base/drawTools/SketchExtentDrawTool.js, line 272

选中草图feature

Name Type Description
feature Feature

被选中草图feature对象

inherited setSketchStyle(sketchStyle)

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 722

设置草图样式

Name Type Description
sketchStyle SketchStyle

inherited setSnapAndReferGeometries(geometries)

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 1839

设置捕获和线造区边界参考几何图形集合

Name Type Description
geometries Array.<Geometry>

可选,几何图形集合。

inherited start()

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 157

开始绘制草图

inherited stop()

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 170

停止绘制草图

inherited updateFeature(point, feature)

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 863

更新feature

Name Type Description
point Point

待更新的位置

feature Feature

被更新的feature

inherited updateVertex(point, index)

sketchEditor/base/drawTools/SketchBaseDrawTool.js, line 921

更新当前草图图形的某个顶点

Name Type Description
point Point

新的顶点

index Number

需更新的顶点的索引值,索引值从0开始