From 114cf32597253d5ad3f2af8f9ebad7b154524eea Mon Sep 17 00:00:00 2001 From: fukunee Date: Sat, 19 Sep 2026 16:01:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=B3=E9=94=AE=E6=8C=89=E4=B8=8B=E6=97=B6?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=B7=A6=E9=94=AE=E6=83=AF=E6=80=A7=E4=BD=99?= =?UTF-8?q?=E5=8A=9B=EF=BC=8C=E9=81=BF=E5=85=8D=E5=8F=A0=E5=8A=A0=E6=97=8B?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/CesiumGlobe.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/scene/CesiumGlobe.js b/src/scene/CesiumGlobe.js index 581a595..4a6bde8 100644 --- a/src/scene/CesiumGlobe.js +++ b/src/scene/CesiumGlobe.js @@ -390,6 +390,17 @@ export class CesiumGlobe { }; handler.setInputAction((movement) => { + // 取消左键旋转/缩放/倾斜的惯性余力,避免右键拖动时叠加成“又转又倾斜” + const ctrl = scene.screenSpaceCameraController; + const inertiaStates = [ + '_lastInertiaSpinMovement', + '_lastInertiaZoomMovement', + '_lastInertiaTiltMovement', + ]; + for (let i = 0; i < inertiaStates.length; i++) { + const st = ctrl[inertiaStates[i]]; + if (st) st.inertiaEnabled = false; + } // 旋转中心 = 相机当前注视的屏幕中心点(地形表面),而不是点击点 const canvas = scene.canvas; const center = Cesium.Cartesian2.fromElements(