-
click
View click事件
用戶單擊視圖後觸發。此事件的發出速度比 immediate-click 事件稍慢,以確保不會觸發雙擊事件。 immediate-click事件可用於立即響應點擊事件。
-
類型 說明 mapPoint Point在Map的空間參考中單擊視圖的點位置。
x Number點擊視圖的橫屏坐標。
y Number點擊視圖的屏幕垂直坐標。
button Number指示單擊了哪個鼠標按鈕。
buttons Number指示當前鼠標按鈕狀態。
值 說明 0 左鍵單擊(或觸摸) 1 中鍵 2 右鍵點擊 type String事件類型。
值永遠是"click".
stopPropagation Function防止事件在事件鏈中冒泡。
timestamp Number發出事件的時間戳(以毫秒為單位)。
native Object標準 DOM PointerEvent 。
屬性:
例子:
// Set up a click event handler and retrieve the screen point view.on("click", function(event) { // the hitTest() checks to see if any graphics in the view // intersect the given screen x, y coordinates view.hitTest(event) .then(getGraphics); });
view.on("click", function(event) { // you must overwrite default click-for-popup // behavior to display your own popup view.popup.autoOpenEnabled = false; // Get the coordinates of the click on the view let lat = Math.round(event.mapPoint.latitude * 1000) / 1000; let lon = Math.round(event.mapPoint.longitude * 1000) / 1000; view.popup.open({ // Set the popup's title to the coordinates of the location title: "Reverse geocode: [" + lon + ", " + lat + "]", location: event.mapPoint // Set the location of the popup to the clicked location content: "This is a point of interest" // content displayed in the popup }); });
-
基本信息
以下是所在類或對象的基本信息。
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 click事件
的定義如下:
相關用法
- JavaScript ArcGIS SceneView double-click事件用法及代碼示例
- JavaScript ArcGIS SceneView mouse-wheel事件用法及代碼示例
- JavaScript ArcGIS SceneView key-down事件用法及代碼示例
- JavaScript ArcGIS SceneView layerview-create事件用法及代碼示例
- JavaScript ArcGIS SceneView layerview-create-error事件用法及代碼示例
- JavaScript ArcGIS SceneView drag事件用法及代碼示例
- JavaScript ArcGIS SceneView pointer-move事件用法及代碼示例
- JavaScript ArcGIS SceneView immediate-click事件用法及代碼示例
- JavaScript ArcGIS SceneView hold事件用法及代碼示例
- JavaScript ArcGIS SceneView.breakpoints用法及代碼示例
- JavaScript ArcGIS SceneView.on用法及代碼示例
- JavaScript ArcGIS SceneView.highlightOptions用法及代碼示例
- JavaScript ArcGIS SceneView用法及代碼示例
- JavaScript ArcGIS SceneView.input用法及代碼示例
- JavaScript ArcGIS SceneView.ui用法及代碼示例
- JavaScript ArcGIS SceneView.whenAnalysisView用法及代碼示例
- JavaScript ArcGIS SceneView.camera用法及代碼示例
- JavaScript ArcGIS SceneView.widthBreakpoint用法及代碼示例
- JavaScript ArcGIS SceneView.navigation用法及代碼示例
- JavaScript ArcGIS SceneView.hitTest用法及代碼示例
- JavaScript ArcGIS SceneView.popup用法及代碼示例
- JavaScript ArcGIS SceneView.graphics用法及代碼示例
- JavaScript ArcGIS SceneView.when用法及代碼示例
- JavaScript ArcGIS SceneView.zoom用法及代碼示例
- JavaScript ArcGIS SceneView.container用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 SceneView click event。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。