From 18a2077369868aff460ea2671a1389ca3e017ae7 Mon Sep 17 00:00:00 2001 From: fukunee Date: Sat, 19 Sep 2026 02:16:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=A0=87=E8=AE=B0=E5=B9=B3?= =?UTF-8?q?=E7=A7=BB=E5=B1=85=E4=B8=AD=EF=BC=8C=E4=B8=8D=E5=86=8D=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/CesiumGlobe.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/scene/CesiumGlobe.js b/src/scene/CesiumGlobe.js index 9c99b53..8b7c7e6 100644 --- a/src/scene/CesiumGlobe.js +++ b/src/scene/CesiumGlobe.js @@ -7,9 +7,6 @@ const IMAGERY_URL = const TERRAIN_URL = 'https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer'; -// 点击标记后飞到的目标高度(米,与初始视图一致,保证左键拖拽始终是“整球旋转”) -const FLY_TO_HEIGHT = 7.2e6; - // 标记便签的离地高度(米):抬到高空,使其 bounding 球比城市/国家名更靠相机, // 从而在透明通道的深度排序中始终后绘制(盖在标签上层)。 const MARKER_ALTITUDE = 50000; @@ -288,8 +285,10 @@ export class CesiumGlobe { const now = Date.now(); if (this._lastFly && now - this._lastFly < 400) return; // 双击/连点去抖,避免重复飞 this._lastFly = now; - this.viewer.camera.flyTo({ - destination: Cesium.Cartesian3.fromDegrees(entry.lng, entry.lat, FLY_TO_HEIGHT), + const camera = this.viewer.camera; + const height = camera.positionCartographic.height; // 保持当前缩放,平移过去 + camera.flyTo({ + destination: Cesium.Cartesian3.fromDegrees(entry.lng, entry.lat, height), orientation: { heading: 0, pitch: Cesium.Math.toRadians(-90),