-
update
当用户开始更新图形、正在主动更新图形并完成更新图形时触发。
-
类型 说明 正在更新的图形数组。
state String事件的状态。
可能的值
值 说明 start 选择要更新图形时,状态更改为 start
。active 状态为 active
而图形正在更新且toolEventInfo
参数不是null
。complete 图形更新后状态更改为 complete
。可能的值:"start"|"active"|"complete"
aborted Boolean指示更新操作是否已中止。如果用户按下退出键,或者在
update
事件的state
更改为complete
之前调用 update()、create() 或 cancel() 方法,则设置为true
。tool String更新操作工具的名称。
可能的值:"move"|"transform"|"reshape"
type String事件的类型。
值永远是"update".
toolEventInfo UpdateToolEventInfo返回与所选图形正在进行的更新操作及其所处阶段相关的附加信息。当
update
事件的state
更改为complete
时,此参数的值将更改为null
。
属性:
例子:
// Listen to sketch's update event to show relevant data in a chart // as the graphics are being moved sketch.on("update", onMove); // Point graphics at the center and edge of the buffer polygon are being moved. // Recalculate the buffer with updated geometry and run the query stats using // the updated buffer and update the chart. function onMove(event) { // If the edge graphic is moving, keep the center graphic // at its initial location. Only move edge graphic to resize the buffer. if (event.toolEventInfo && event.toolEventInfo.mover.attributes.edge) { const toolType = event.toolEventInfo.type; if (toolType === "move-start") { centerGeometryAtStart = centerGraphic.geometry; } // keep the center graphic at its initial location when edge point is moving else if (toolType === "move" || toolType === "move-stop") { centerGraphic.geometry = centerGeometryAtStart; } } // the center or edge graphic is being moved, recalculate the buffer const vertices = [ [centerGraphic.geometry.x, centerGraphic.geometry.y], [edgeGraphic.geometry.x, edgeGraphic.geometry.y] ]; // client-side stats query of features that intersect the buffer calculateBuffer(vertices); // user is clicking on the view... call update method with the center and edge graphics if (event.state === "complete") { sketch.update({ tool: "move", graphics: [edgeGraphic, centerGraphic] }); } }
-
基本信息
以下是所在类或对象的基本信息。
AMD:
require(["esri/widgets/Sketch"], (Sketch) => { /* code goes here */ });
ESM:
import Sketch from "@arcgis/core/widgets/Sketch";
类:
esri/widgets/Sketch
继承: Sketch > Widget > Accessor
自从:用于 JavaScript 4.10 的 ArcGIS API
用法说明
Sketch update事件
的定义如下:
相关用法
- JavaScript ArcGIS Sketch create事件用法及代码示例
- JavaScript ArcGIS Sketch delete事件用法及代码示例
- JavaScript ArcGIS Sketch.classes用法及代码示例
- JavaScript ArcGIS Sketch.visible用法及代码示例
- JavaScript ArcGIS Sketch.create用法及代码示例
- JavaScript ArcGIS Sketch.VisibleElements用法及代码示例
- JavaScript ArcGIS Sketch.update用法及代码示例
- JavaScript ArcGIS Sketch.RotateEventInfo用法及代码示例
- JavaScript ArcGIS Sketch.MoveEventInfo用法及代码示例
- JavaScript ArcGIS Sketch.VertexAddEventInfo用法及代码示例
- JavaScript ArcGIS Sketch.visibleElements用法及代码示例
- JavaScript ArcGIS Sketch.CursorUpdateEventInfo用法及代码示例
- JavaScript ArcGIS Sketch.ReshapeEventInfo用法及代码示例
- JavaScript ArcGIS Sketch用法及代码示例
- JavaScript ArcGIS SketchEdges3D用法及代码示例
- JavaScript ArcGIS Sketch.VertexRemoveEventInfo用法及代码示例
- JavaScript ArcGIS Sketch.when用法及代码示例
- JavaScript ArcGIS Sketch.on用法及代码示例
- JavaScript ArcGIS Sketch.container用法及代码示例
- JavaScript ArcGIS Sketch.SelectionChangeEventInfo用法及代码示例
- JavaScript ArcGIS SceneView double-click事件用法及代码示例
- JavaScript ArcGIS Sublayer.JoinTableDataSource用法及代码示例
- JavaScript ArcGIS Slider.effectiveMin用法及代码示例
- JavaScript ArcGIS Swipe.when用法及代码示例
- JavaScript ArcGIS Slider.container用法及代码示例
注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 Sketch update event。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。