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


JavaScript ArcGIS SceneView hold事件用法及代码示例


基本信息

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

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

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

类: esri/views/SceneView

继承: SceneView > View > Accessor

自从:用于 JavaScript 4.0 的 ArcGIS API

用法说明

SceneView hold事件的定义如下:


在视图上按住鼠标按钮或单指短时间后触发。

属性:

类型说明
mapPoint Point

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

x Number

在视图上保持的水平屏幕坐标。

y Number

在视图上保持的垂直屏幕坐标。

button Number

指示按下了哪个鼠标按钮。见MouseEvent.button

说明
0 鼠标左键(或触摸)
1 鼠标中键
2 鼠标右键

可能的值0|1|2

buttons Number

指示触发事件时按下了哪些鼠标按钮。见MouseEvent.buttons

type String

事件类型。

值永远是"hold".

stopPropagation Function

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

timestamp Number

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

native Object

标准 DOM PointerEvent

例子:

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

相关用法


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