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),