-
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。