当前位置:网站首页>Cesium 绑定鼠标事件和移除鼠标事件
Cesium 绑定鼠标事件和移除鼠标事件
2022-07-17 05:06: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 //鼠标滚轮事件
边栏推荐
猜你喜欢

MD5 password encryption

Email (including attachments, Netease, QQ)

Feature extraction of machine learning (digitization and discretization of category features and digitization of text features)

微信小程序获取年月日周及早上、中午、晚上

Installation and fast use of Mongo DB stand-alone version

Baidu map realizes thermal map

PyGame aircraft War 1.0 (step + window no response problem)

Actual cases of data analysis and data mining local house price prediction (716):

IText modify PDF Text

The code of yolov5 model for pest identification in Title A of the 10th Teddy cup data mining challenge (has been run through, original works, continuously updated)
随机推荐
无重复字符的最长字串
使用js中的(offset,page)实现登录效果
Mongo DB aggregate operations and indexes
Applet editor rich text editing and rich text parsing
PAT乙级1002:写出这个数
Wechat applet status bar
IDL调用6S大气校正
实习项目2-主页配置-我的数据模块
PAT乙级1017: A除以B
(elaborate) ES6 remaining parameters, ES6 built-in objects, template string content (detailed example Dictionary) and practical cases of flexible use of the project
H5页面使用js生成二维码
computed和watch的区别
第十届泰迪杯数据挖掘挑战赛A题害虫识别YOLOv5模型代码(已跑通,原创作品,持续更新)
NVIDIA GeForce Experience登录报错:验证程序加载失败,请检查您的浏览器设置,例如广告拦截程序(解决办法)
【Es6】详细解说Set ,Array的常用对象及其他方法(完整版)
Es6最新常用知识宝典(能够帮助你解决面试题困惑,编写程序中出现的问题等)
(精讲)Es6 剩余参数,ES6内置对象,模板字符串内容(详例宝典)及灵活运用项目的实战案例
【Es6】forEach,for...in ,for...of专栏,让你通过项目案例快速分辨各种for语句的使用方式及区别(完整版)内部有详细注释
User management - restrictions
【C语言—零基础第十课】数组王国奇遇记