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