From 098a769dbde14a4138f9ae79992c2081a48d9a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Wed, 2 Apr 2025 15:33:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=BA=E5=8D=AB=E6=98=9F=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E5=92=8C=E8=A6=86=E7=9B=96=E8=8C=83=E5=9B=B4=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=9A=8F=E6=9C=BA=E5=9F=BA=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../h-cesium-viewer/h-cesium-viewer-class.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/h-cesium-viewer/h-cesium-viewer-class.ts b/src/components/h-cesium-viewer/h-cesium-viewer-class.ts index b9551d9..530f5c4 100644 --- a/src/components/h-cesium-viewer/h-cesium-viewer-class.ts +++ b/src/components/h-cesium-viewer/h-cesium-viewer-class.ts @@ -183,6 +183,9 @@ export class HCesiumViewerCls { return null; } + // 生成随机基色 + const randomBaseColor = Cesium.Color.fromRandom(); + // 创建卫星实体 const satelliteEntity = this.viewer.entities.add({ id: id, @@ -200,7 +203,7 @@ export class HCesiumViewerCls { // 使用点表示卫星 point: { pixelSize: 8, - color: Cesium.Color.YELLOW, + color: randomBaseColor, // 使用随机基色 outlineColor: Cesium.Color.WHITE, outlineWidth: 1, }, @@ -209,7 +212,7 @@ export class HCesiumViewerCls { resolution: 1, material: new Cesium.PolylineGlowMaterialProperty({ glowPower: 0.15, - color: Cesium.Color.BLUE, + color: randomBaseColor, // 使用随机基色 }), width: 2, leadTime: (orbitDurationHours * 3600) / 2, // 显示未来一半时间的轨迹 @@ -308,12 +311,12 @@ export class HCesiumViewerCls { ellipse: { semiMajorAxis: coverageRadius, semiMinorAxis: coverageRadius, // 假设圆形覆盖 - material: Cesium.Color.RED.withAlpha(0.3), // 半透明红色 + material: randomBaseColor.withAlpha(0.2), // 基于随机基色的半透明填充 heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, // 贴合地形 outline: true, - outlineColor: Cesium.Color.BLACK.withAlpha(0.5), - outlineWidth: 1, - // fill: true, // 默认填充 + outlineColor: randomBaseColor.withAlpha(0.8), // 基于随机基色的较深半透明轮廓 + outlineWidth: 2, // + granularity: Cesium.Math.toRadians(1), // 控制椭圆边缘平滑度 }, }); // --- 覆盖范围结束 --- @@ -328,7 +331,7 @@ export class HCesiumViewerCls { positions: orbitPositions, width: 1, material: new Cesium.PolylineDashMaterialProperty({ - color: Cesium.Color.CYAN.withAlpha(0.5), // 半透明青色虚线 + color: randomBaseColor.withAlpha(0.5), // 基于随机基色的半透明虚线 dashLength: 16, }), clampToGround: false, // 轨道不贴地