当前位置:网站首页>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 //鼠標滾輪事件
边栏推荐
- 这么6的刷题网站你不会没听说过吧?你已经out 了?
- Simply and quickly establish a pytorch environment yolov5 target detection model to run (super simple)
- 【LeetCode——编程能力入门第一天】基本数据类型[在区间范围内统计奇数数目/去掉最低工资和最高工资后的工资平均值)
- (elaborate) ES6 remaining parameters, ES6 built-in objects, template string content (detailed example Dictionary) and practical cases of flexible use of the project
- Pat class B 1002: write this number
- 轮播图移动速度(匀速,缓动)案例归总
- 【C语言—零基础第十四课】变量的作用域与存储类
- es6新增-对象部分
- 微信小程序5-基础加强(没写完)
- uniapp 使用uview实现折叠面板
猜你喜欢

Wechat applet cloud development and use method-1

Ucharts chart, pie chart, bar chart and line chart are used in uniapp

645. 错误的集合

Internship project 2 - Homepage configuration - my data module

简单快速建立pytorch环境YOLOv5目标检测 模型跑起来(超简单)

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

Applet editor rich text editing and rich text parsing

uniapp 表单(input、radio、picker)提交获取参数值

微信小程序 学习笔记

实习项目2-主页配置-我的数据模块
随机推荐
[ES6] explain in detail the common objects and other methods of set and array (full version)
Pat class B 1017: a divided by B
遍历的方法总结
关于New_Online_Judge_1081_哥德巴赫猜想的思考
获取URL参数的两种方法及location对象的各项获取方式
(精讲)Es6 剩余参数,ES6内置对象,模板字符串内容(详例宝典)及灵活运用项目的实战案例
About the current response, the method getoutputstream() has been called
PAT乙级1002:写出这个数
使用js实现安居客二级菜单及(注意事项和问题点演示)完整版
决策树原理和案例应用-泰坦尼克号生存预测
es6新增-运算符的扩展
轮播图的两种方法及自动轮播
热更新及其原理
Feature extraction of machine learning (digitization and discretization of category features and digitization of text features)
es6新增-数组部分
Internship project 1 - personalized homepage configuration
硬核结构体,暴力解读
6S参数
Teddy Cup title a full version optimization update (4/23)
IDL MODIS 生成查找表