当前位置:网站首页>Cesium 綁定鼠標事件和移除鼠標事件
Cesium 綁定鼠標事件和移除鼠標事件
2022-07-19 05:13:00 【Wxy4Z1zzz】
1、綁定鼠標事件
方法一:每次都創建一個實例,可以多個共存且根據名字(變量比如:下面的handler)可以清除指定事件(推薦使用)。

方法二:直接在viewer實例上添加,清除事件會污染整個viewer實例且當前實例存在其它鼠標事件會一並清除(適合一鍵清除地圖上事件)。

2、移除鼠標事件
方法一:
handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK)//移除事件方法二:
viewer.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);3、Cesium常用事件類型
Cesium.ScreenSpaceEventType.LEFT_CLICK //鼠標左擊事件
Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK //鼠標左鍵雙擊事件
Cesium.ScreenSpaceEventType.LEFT_DOWN //左鍵鼠標按下事件
Cesium.ScreenSpaceEventType.LEFT_UP //左鍵鼠標抬起事件
Cesium.ScreenSpaceEventType.MIDDLE_CLICK //中鍵單機
Cesium.ScreenSpaceEventType.MIDDLE_DOWN //中鍵按下
Cesium.ScreenSpaceEventType.MIDDLE_UP //中鍵抬起
Cesium.ScreenSpaceEventType.MOUSE_MOVE //鼠標移動
Cesium.ScreenSpaceEventType.PINCH_END //錶示兩指事件在觸摸面上的結束。
Cesium.ScreenSpaceEventType.PINCH_MOVE //兩指移動
Cesium.ScreenSpaceEventType.PINCH_START //錶示在觸摸面上發生兩指事件的開始。
Cesium.ScreenSpaceEventType.RIGHT_CLICK //鼠標右擊事件
Cesium.ScreenSpaceEventType.RIGHT_DOWN //鼠標右鍵按下
Cesium.ScreenSpaceEventType.RIGHT_UP //鼠標右鍵抬起
Cesium.ScreenSpaceEventType.WHEEL //鼠標滾輪事件
边栏推荐
猜你喜欢

es6新增-Symbol数据类型

模拟库函数

Word2Vec原理及应用与文章相似度(推荐系统方法)

Bi design: distributed high concurrency epidemic prevention health management system based on vue+socket+redis

读论文《SNUNet-CD: A Densely Connected Siamese Network for Change Detection of VHR Images》

PCA feature dimensionality reduction of machine learning + case practice

微信小程序云开发使用方法-1

uniapp中使用ucharts图表,饼状图,柱状图,折线图

Submit the uniapp form (input, radio, picker) to get the parameter value

Asynchronous data SMS verification code
随机推荐
Cesium 绑定鼠标事件和移除鼠标事件
Baidu map realizes thermal map
Teddy Cup title a full version optimization update (4/23)
es6新增-let和const (var的缺点&let及const)
滚动轮加载的两种js方法及模态框拖拽归总
这么6的刷题网站你不会没听说过吧?你已经out 了?
STL容器——vector的基本操作
哨兵二号轨道数据下载
Ucharts chart, pie chart, bar chart and line chart are used in uniapp
uni-app 条件编译#ifdef #endif 兼容多个终端
学习C语言第8天
MySQL optimization
IDL调用6S大气校正
微信小程序wx.setClipboardData复制文本
轮播图节流阀原理及本地存储归总
Es6最新常用知识宝典(能够帮助你解决面试题困惑,编写程序中出现的问题等)
Wechat applet status bar
Database training 7 [index and creation of data integrity constraints]
mysql数据库实验实训6,数据视图(详细)
【Es6】forEach,for... in ,for... Of column, which allows you to quickly distinguish the usage and differences of various for statements through project cases (full version). There are detailed notes ins