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


JavaScript ArcGIS MapView double-click事件用法及代码示例


基本信息

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

AMD: require(["esri/views/MapView"], (MapView) => { /* code goes here */ });

ESM: import MapView from "@arcgis/core/views/MapView";

类: esri/views/MapView

继承: MapView > View > Accessor

自从:用于 JavaScript 4.0 的 ArcGIS API

用法说明

MapView double-click事件的定义如下:


在视图上的 double-clicking 之后触发。

属性:

类型说明
mapPoint Point

在Map的空间参考中单击视图的点位置。

x Number

点击视图的横屏坐标。

y Number

点击视图的屏幕垂直坐标。

button Number

指示单击了哪个鼠标按钮。

buttons Number

指示当前鼠标按钮状态。

说明
0 左键单击(或触摸)
1 中键
2 右键点击

可能的值0|1|2

type String

事件类型。

值永远是"double-click".

stopPropagation Function

防止事件在事件链中冒泡。

timestamp Number

发出事件的时间戳(以毫秒为单位)。

native Object

标准 DOM PointerEvent

例子:

view.on("double-click", function(event) {
  // The event object contains the mapPoint and the screen coordinates of the location
  // that was clicked.
  console.log("screen point", event.x, event.y);
  console.log("map point", event.mapPoint);
});

相关用法


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