Prevent text selection and restrict globe/camera controls
Disable copy, cut, and context menu site-wide, and limit Cesium camera input to left-drag rotation and wheel zoom only. Also speed up page flip animation from 1.3s to 0.6s with an ease-out curve for a snappier feel.
This commit is contained in:
@@ -57,6 +57,19 @@ export class CesiumGlobe {
|
||||
controller.minimumZoomDistance = 10000; // 最近约 10 km(区域尺度)
|
||||
controller.maximumZoomDistance = 8e6; // 最远约 8000 km
|
||||
|
||||
// 限制鼠标按钮:只保留左键旋转 + 滚轮缩放;禁用中键倾斜、右键缩放
|
||||
controller.zoomEventTypes = [
|
||||
Cesium.CameraEventType.WHEEL,
|
||||
Cesium.CameraEventType.PINCH,
|
||||
];
|
||||
controller.tiltEventTypes = [
|
||||
Cesium.CameraEventType.PINCH,
|
||||
{
|
||||
eventType: Cesium.CameraEventType.LEFT_DRAG,
|
||||
modifier: Cesium.KeyboardEventModifier.CTRL,
|
||||
},
|
||||
];
|
||||
|
||||
// 精细化渲染:质量与性能的平衡
|
||||
scene.globe.maximumScreenSpaceError = 2.0; // 默认细分,最省性能
|
||||
scene.globe.tileCacheSize = 600; // 更大的瓦片缓存,减少细节刷新
|
||||
|
||||
Reference in New Issue
Block a user