当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


JavaScript ArcGIS Sketch.ReshapeEventInfo用法及代码示例


基本信息

以下是所在类或对象的基本信息。

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.ReshapeEventInfo函数(或属性)的定义如下:

ReshapeEventInfo Object


当用户重塑图形时,此信息作为更新事件的 toolEventInfo 参数返回。它返回与重塑操作及其所处阶段相关的附加信息。

属性:
类型说明
type String

返回指示重塑操作阶段的信息。

可能的值

说明
reshape-start reshape 操作开始时,类型更改为reshape-start
reshape 当图形被重新塑造时,类型变为reshape
reshape-stop 一旦图形被重新塑造,类型就会更改为reshape-stop

可能的值"reshape-start"|"reshape"|"reshape-stop"

例子:

// listen to update event
sketch.on("update", function(event){
  // check if the graphics are done being reshaped, printout updated graphic's geometry and reshape stage.
  const eventInfo = event.toolEventInfo;
  if (eventInfo && eventInfo.type.includes("reshape")) {
    console.log(eventInfo.type, event.graphics[0].geometry);
  }
});

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 Sketch.ReshapeEventInfo。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。