zoukankan      html  css  js  c++  java
  • cesium怎么清除handler&删除所有实体

    一、

    2、取消左键双击事件

    viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);

    参考1:https://blog.csdn.net/weixin_40184249/article/details/91404371

    二、

    removeEventHandler

    // 别名,但不建议使用。
    this.addEventListener = this.on;
    this.removeEventListener = this.clearAllEventListeners = this.off;

    cesium removeeventlistener函数

    cesium绑定鼠标事件,及清除事件(采坑清除事件不起作用,解决方案):https://blog.csdn.net/weixin_44058725/article/details/105856045

    事件:

    Cesium.ScreenSpaceEventType.MOUSE_MOVE:鼠标移动
    Cesium.ScreenSpaceEventType.LEFT_CLICK:鼠标左键点击
    Cesium.ScreenSpaceEventType.WHEEL:滚轮缩放
     
    >>>清除实体
    Cesium知识点(一):实体对象的添加、获取、删除:https://www.codeleading.com/article/66461176977/
    Cesium区分单击【LEFT_CLICK】和双击事件【LEFT_DOUBLE_CLICK】:https://www.cnblogs.com/aizai846/p/11315891.html   https://blog.csdn.net/qq_18144905/article/details/82178132
     
    监听滚轮
       //设置鼠标滚动事件的处理函数,这里负责监听高度值变化
        this.handler.setInputAction(function(wheelment) {
            height = Math.ceil(viewer.camera.positionCartographic.height);
            entity.position = cartesian;
            entity.label.show = true;
            entity.label.text = '(' + longitudeString + ', ' + latitudeString + "," + height + ')' ;
            entity.label.fillColor = Cesium.Color.BLACK;
        }, Cesium.ScreenSpaceEventType.WHEEL);
  • 相关阅读:
    403
    311
    401
    310
    308
    309
    307
    304
    3-1
    2-11
  • 原文地址:https://www.cnblogs.com/2008nmj/p/15581573.html
Copyright © 2011-2022 走看看