let { scene, camera } = viewer
// 禁止默认的事件
scene.screenSpaceCameraController.enableRotate = false;//禁止旋转
scene.screenSpaceCameraController.enableTranslate = false;// 禁止移动
scene.screenSpaceCameraController.enableZoom = false;//禁止缩放
scene.screenSpaceCameraController.enableTilt = false;//禁止倾斜相机
scene.screenSpaceCameraController.enableLook = false;
let cameraHeight = 1000
//相机高度最小值,即控制放大级别
scene.screenSpaceCameraController.minimaZoomDistance = cameraHeight * 2
//相机高度最大值,即控制缩小级别
scene.screenSpaceCameraController.maximumZoomDistance = cameraHeight * 3
let pointDestination = Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 1500);//视野点
// let rectangleDestination = Cesium.Rectangle.fromDegrees(0, 20, 10, 30);//视野区域,由[西,南,东,北]四个度数来构成
scene.camera.setView({
destination: pointDestination,
orientation: {
heading: 6.283185307179586,
pitch: -1.5707963267948966,
roll: 0
}
})
cesium相机限制事件
最新推荐文章于 2024-09-10 09:07:00 发布