From ed7d377eb6f9e162223acd19dda5a869f96c9362 Mon Sep 17 00:00:00 2001 From: fukunee Date: Sat, 19 Sep 2026 02:15:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E8=AE=B0=E4=BE=BF=E7=AD=BE=E6=8A=AC?= =?UTF-8?q?=E8=87=B3=E9=AB=98=E7=A9=BA=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=B7=B1?= =?UTF-8?q?=E5=BA=A6=E6=8E=92=E5=BA=8F=E7=9B=96=E5=9C=A8=E5=9F=8E=E5=B8=82?= =?UTF-8?q?/=E5=9B=BD=E5=AE=B6=E5=90=8D=E4=B8=8A=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scene/CesiumGlobe.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/scene/CesiumGlobe.js b/src/scene/CesiumGlobe.js index c800041..9c99b53 100644 --- a/src/scene/CesiumGlobe.js +++ b/src/scene/CesiumGlobe.js @@ -10,6 +10,10 @@ const TERRAIN_URL = // 点击标记后飞到的目标高度(米,与初始视图一致,保证左键拖拽始终是“整球旋转”) const FLY_TO_HEIGHT = 7.2e6; +// 标记便签的离地高度(米):抬到高空,使其 bounding 球比城市/国家名更靠相机, +// 从而在透明通道的深度排序中始终后绘制(盖在标签上层)。 +const MARKER_ALTITUDE = 50000; + // 计算多边形集合的球面面积(km²),用于按国土面积分级国家名字号 function sphericalAreaKm2(polys) { let area = 0; @@ -242,14 +246,13 @@ export class CesiumGlobe { const noteSelected = makeStickyNote(entry.name, 19, true); const entity = viewer.entities.add({ - position: Cesium.Cartesian3.fromDegrees(entry.lng, entry.lat), + position: Cesium.Cartesian3.fromDegrees(entry.lng, entry.lat, MARKER_ALTITUDE), billboard: { image: noteNormal.canvas, scale: noteNormal.scale, horizontalOrigin: Cesium.HorizontalOrigin.LEFT, verticalOrigin: Cesium.VerticalOrigin.CENTER, pixelOffset: new Cesium.Cartesian2(0, 0), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, disableDepthTestDistance: Number.POSITIVE_INFINITY, distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1e7), },