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, // 轨道不贴地