【Cesium】设置操作习惯,更换中键和右键

2021-11-10 14:58:25 浏览数 (2)

最近做项目需要把之前用的高德GIS更换成离线GIS,考虑了一些问题后选择用Cesium作为开发引擎,但是用起来不顺手,通过以下方法修改后操作习惯些;

代码语言:javascript复制
    //设置操作习惯,更换中键和右键
        Ning.OperationHabit = function () {
            viewer.scene.screenSpaceCameraController.tiltEventTypes = [
                Cesium.CameraEventType.RIGHT_DRAG, Cesium.CameraEventType.PINCH,
                { eventType: Cesium.CameraEventType.LEFT_DRAG, modifier: Cesium.KeyboardEventModifier.CTRL },
                { eventType: Cesium.CameraEventType.RIGHT_DRAG, modifier: Cesium.KeyboardEventModifier.CTRL }
            ];

            viewer.scene.screenSpaceCameraController.zoomEventTypes = [
                Cesium.CameraEventType.MIDDLE_DRAG, Cesium.CameraEventType.WHEEL, Cesium.CameraEventType.PINCH
            ];
        }

0 人点赞