标签字号再调大;国家名最大距离恢复1e7

This commit is contained in:
2026-09-19 17:30:55 +08:00
parent 63777b83ce
commit 52b09f5049
+4 -4
View File
@@ -555,7 +555,7 @@ export class CesiumGlobe {
let cname = props.NAME_ZH || props.NAME; let cname = props.NAME_ZH || props.NAME;
if (cname === '中华民国') cname = '中国台湾'; if (cname === '中华民国') cname = '中国台湾';
if (cname && props.LABEL_X != null && props.LABEL_Y != null) { if (cname && props.LABEL_X != null && props.LABEL_Y != null) {
const fontSize = areaKm2 > 5e6 ? 24 : areaKm2 > 1.5e6 ? 17 : areaKm2 > 3e5 ? 14 : 12; const fontSize = areaKm2 > 5e6 ? 26 : areaKm2 > 1.5e6 ? 19 : areaKm2 > 3e5 ? 16 : 14;
countryLabels.add({ countryLabels.add({
position: Cesium.Cartesian3.fromDegrees(props.LABEL_X, props.LABEL_Y), position: Cesium.Cartesian3.fromDegrees(props.LABEL_X, props.LABEL_Y),
text: cname, text: cname,
@@ -566,9 +566,9 @@ export class CesiumGlobe {
style: Cesium.LabelStyle.FILL_AND_OUTLINE, style: Cesium.LabelStyle.FILL_AND_OUTLINE,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: 1000, // 1km 内不深度测试(近处不消失),远处仍遮挡背面 disableDepthTestDistance: 1000, // 1km 内不深度测试(近处不消失),远处仍遮挡背面
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 6e6), distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0, 1e7),
scaleByDistance: new Cesium.NearFarScalar(1e4, 20 / 15, 6e6, 1.0), scaleByDistance: new Cesium.NearFarScalar(1e4, 20 / 15, 6e6, 1.0),
translucencyByDistance: new Cesium.NearFarScalar(5e6, 1.0, 6e6, 0.0), translucencyByDistance: new Cesium.NearFarScalar(9e6, 1.0, 1e7, 0.0),
}); });
} }
@@ -638,7 +638,7 @@ export class CesiumGlobe {
labels.add({ labels.add({
position, position,
text: c.name, text: c.name,
font: 'bold 13px "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif', font: 'bold 15px "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif',
fillColor: textGold, fillColor: textGold,
outlineColor: black, outlineColor: black,
outlineWidth: 2, outlineWidth: 2,