From 02ce0fa9a06aa7a86d7061acde78ba570a99a270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Wed, 2 Apr 2025 16:38:02 +0800 Subject: [PATCH] h-cesium-viewer --- src/components/h-cesium-viewer/README.md | 4 - .../h-cesium-viewer/_资料/README copy.md | 4 + .../h-cesium-viewer/_资料}/README.md | 0 .../h-cesium-viewer/h-cesium-viewer-class.ts | 50 +++--- .../h-cesium-viewer-class.types.ts | 20 +++ .../{index.vue => h-cesium-viewer.vue} | 0 .../h-cesium-viewer/helper}/_TOOLTIP_MAP.ts | 0 .../_VIEWER_OPTIONS.ts} | 0 .../helper/configureCesium.ts} | 34 +--- .../helper/configureMapTile.ts} | 0 .../helper/configureTimeLine.ts | 20 +++ .../00.cesium-init.VIEWER_OPTIONS.ts | 33 ---- .../Cesium/components/SatelliteSelector.vue | 170 ------------------ src/pages/Satellite/Cesium/index.page.vue | 78 -------- src/pages/Satellite/SatNOGS/index.page.MD | 1 - .../_TLE_DATA.ts | 0 .../demo_01_OrbitGeneration.ts | 0 .../demo_02_Track.ts | 47 ++--- .../demo_03_卫星加站点.ts | 0 .../归档}/SatelliteEntity.ts | 0 typed-router.d.ts | 1 - 21 files changed, 95 insertions(+), 367 deletions(-) delete mode 100644 src/components/h-cesium-viewer/README.md create mode 100644 src/components/h-cesium-viewer/_资料/README copy.md rename src/{pages/Satellite/Cesium/cesium-helper => components/h-cesium-viewer/_资料}/README.md (100%) create mode 100644 src/components/h-cesium-viewer/h-cesium-viewer-class.types.ts rename src/components/h-cesium-viewer/{index.vue => h-cesium-viewer.vue} (100%) rename src/{pages/Satellite/Cesium/cesium-helper => components/h-cesium-viewer/helper}/_TOOLTIP_MAP.ts (100%) rename src/components/h-cesium-viewer/{VIEWER_OPTIONS.ts => helper/_VIEWER_OPTIONS.ts} (100%) rename src/{pages/Satellite/Cesium/cesium-helper/00.cesium-init.ts => components/h-cesium-viewer/helper/configureCesium.ts} (57%) rename src/{pages/Satellite/Cesium/cesium-helper/00.cesium-init.globe.ts => components/h-cesium-viewer/helper/configureMapTile.ts} (100%) create mode 100644 src/components/h-cesium-viewer/helper/configureTimeLine.ts delete mode 100644 src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.VIEWER_OPTIONS.ts delete mode 100644 src/pages/Satellite/Cesium/components/SatelliteSelector.vue delete mode 100644 src/pages/Satellite/Cesium/index.page.vue delete mode 100644 src/pages/Satellite/SatNOGS/index.page.MD rename src/pages/{Satellite/Cesium/cesium-demos => _cesium-demos}/_TLE_DATA.ts (100%) rename src/pages/{Satellite/Cesium/cesium-demos => _cesium-demos}/demo_01_OrbitGeneration.ts (100%) rename src/pages/{Satellite/Cesium/cesium-demos => _cesium-demos}/demo_02_Track.ts (88%) rename src/pages/{Satellite/Cesium/cesium-demos => _cesium-demos}/demo_03_卫星加站点.ts (100%) rename src/pages/{Satellite/Cesium/cesium-helper => _cesium-demos/归档}/SatelliteEntity.ts (100%) diff --git a/src/components/h-cesium-viewer/README.md b/src/components/h-cesium-viewer/README.md deleted file mode 100644 index cf60040..0000000 --- a/src/components/h-cesium-viewer/README.md +++ /dev/null @@ -1,4 +0,0 @@ -- 卫星覆盖范围: 当前实现是基于卫星高度的一个简化估算(altitude * 0.8),代码注释也指明了这一点。这种方法不够精确,仅能提供一个大致的视觉参考。精确的覆盖范围计算需要考虑卫星的视场角 (FOV) 或波束宽度等具体参数。 -- TLE 数据 → 轨道 → 位置 & 速度 -- 大小 → 需要外部规格数据 -- 精确姿态 → 需要专门的 ADCS 数据 (TLE 不提供) diff --git a/src/components/h-cesium-viewer/_资料/README copy.md b/src/components/h-cesium-viewer/_资料/README copy.md new file mode 100644 index 0000000..9b7d598 --- /dev/null +++ b/src/components/h-cesium-viewer/_资料/README copy.md @@ -0,0 +1,4 @@ +- 卫星覆盖范围: 当前实现是基于卫星高度的一个简化估算(altitude \* 0.8),代码注释也指明了这一点。这种方法不够精确,仅能提供一个大致的视觉参考。精确的覆盖范围计算需要考虑卫星的视场角 (FOV) 或波束宽度等具体参数。 +- TLE 数据 → 轨道 → 位置 & 速度 +- 大小 → 需要外部规格数据 +- 精确姿态 → 需要专门的 ADCS 数据 (TLE 不提供) diff --git a/src/pages/Satellite/Cesium/cesium-helper/README.md b/src/components/h-cesium-viewer/_资料/README.md similarity index 100% rename from src/pages/Satellite/Cesium/cesium-helper/README.md rename to src/components/h-cesium-viewer/_资料/README.md 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 530f5c4..6dd8162 100644 --- a/src/components/h-cesium-viewer/h-cesium-viewer-class.ts +++ b/src/components/h-cesium-viewer/h-cesium-viewer-class.ts @@ -1,31 +1,24 @@ import * as Cesium from 'cesium'; import { eciToEcf, gstime, propagate, type SatRec, twoline2satrec } from 'satellite.js'; -import { VIEWER_OPTIONS_FN } from './VIEWER_OPTIONS'; +import type { GroundStationOptions, SatelliteOptions } from './h-cesium-viewer-class.types'; // 2小时 -export interface GroundStationOptions { - height?: number; // 可选高度,默认为0 - id: string; // 站点的唯一标识符 - latitude: number; - longitude: number; - name: string; - pixelSize?: number; // 点的可选像素大小 -} +import { VIEWER_OPTIONS_FN } from './helper/_VIEWER_OPTIONS'; +import { configureCesium } from './helper/configureCesium'; +import { configureTimeLine } from './helper/configureTimeLine'; -// 卫星选项接口 -export interface SatelliteOptions { - id: string; // 卫星的唯一标识符 - orbitDurationHours?: number; // 轨道显示时长(小时),默认为 2 - showOrbit?: boolean; // 是否显示完整轨道线,默认为 true - timeStepSeconds?: number; // 轨道计算步长(秒),默认为 30 - tle: string; // 包含卫星名称和两行 TLE 数据的字符串,格式如下: - // NAME - // TLE1 - // TLE2 -} +const 默认轨道时长秒 = 2 * 60 * 60; + +export { type GroundStationOptions, type SatelliteOptions } from './h-cesium-viewer-class.types'; + +Cesium.Ion.defaultAccessToken = import.meta.env.VITE_CESIUM_ION_TOKEN; // 用了离线地图的情况是不需要的。 + +Object.assign(globalThis, { Cesium }); + +configureCesium(); export class HCesiumViewerCls { - private viewer: Cesium.Viewer | null = null; + viewer: Cesium.Viewer | null = null; // 用于存储当前地面站实体的 Map currentStationEntities: Map = new Map(); // 用于存储当前卫星实体的 Map (包括轨道实体) @@ -45,6 +38,10 @@ export class HCesiumViewerCls { initCesiumViewer(container: ConstructorParameters[0]) { this.viewer = new Cesium.Viewer(container, VIEWER_OPTIONS_FN()); + configureTimeLine(this.viewer); + + this.viewer.scene.debugShowFramesPerSecond = true; + // 初始化时清空可能存在的旧实体引用 this.currentStationEntities.clear(); this.currentSatelliteEntities.clear(); @@ -158,7 +155,7 @@ export class HCesiumViewerCls { const { id, tle, - orbitDurationHours = 2, // 默认轨道时长 2 小时 + orbitDurationSeconds = 默认轨道时长秒, timeStepSeconds = 30, // 默认步长 30 秒 showOrbit = true, // 默认显示轨道 } = options; @@ -215,18 +212,17 @@ export class HCesiumViewerCls { color: randomBaseColor, // 使用随机基色 }), width: 2, - leadTime: (orbitDurationHours * 3600) / 2, // 显示未来一半时间的轨迹 - trailTime: (orbitDurationHours * 3600) / 2, // 显示过去一半时间的轨迹 + leadTime: orbitDurationSeconds / 2, // 显示未来一半时间的轨迹 + trailTime: orbitDurationSeconds / 2, // 显示过去一半时间的轨迹 }, }); // --- 计算轨道 --- - const totalSeconds = orbitDurationHours * 60 * 60; const startTime = this.viewer.clock.currentTime; // 使用当前 viewer 的时间作为起点 const positionProperty = new Cesium.SampledPositionProperty(); const orbitPositions: Cesium.Cartesian3[] = []; // 用于存储完整轨道点 - for (let i = 0; i <= totalSeconds; i += timeStepSeconds) { + for (let i = 0; i <= orbitDurationSeconds; i += timeStepSeconds) { const time = Cesium.JulianDate.addSeconds(startTime, i, new Cesium.JulianDate()); const jsDate = Cesium.JulianDate.toDate(time); @@ -311,7 +307,7 @@ export class HCesiumViewerCls { ellipse: { semiMajorAxis: coverageRadius, semiMinorAxis: coverageRadius, // 假设圆形覆盖 - material: randomBaseColor.withAlpha(0.2), // 基于随机基色的半透明填充 + material: randomBaseColor.withAlpha(0.2 + 0.3), // 基于随机基色的半透明填充 heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, // 贴合地形 outline: true, outlineColor: randomBaseColor.withAlpha(0.8), // 基于随机基色的较深半透明轮廓 diff --git a/src/components/h-cesium-viewer/h-cesium-viewer-class.types.ts b/src/components/h-cesium-viewer/h-cesium-viewer-class.types.ts new file mode 100644 index 0000000..771f04d --- /dev/null +++ b/src/components/h-cesium-viewer/h-cesium-viewer-class.types.ts @@ -0,0 +1,20 @@ +export interface GroundStationOptions { + height?: number; // 可选高度,默认为0 + id: string; // 站点的唯一标识符 + latitude: number; + longitude: number; + name: string; + pixelSize?: number; // 点的可选像素大小 +} + +// 卫星选项接口 +export interface SatelliteOptions { + id: string; // 卫星的唯一标识符 + orbitDurationSeconds?: number; // 轨道显示时长 + showOrbit?: boolean; // 是否显示完整轨道线,默认为 true + timeStepSeconds?: number; // 轨道计算步长(秒),默认为 30 + tle: string; // 包含卫星名称和两行 TLE 数据的字符串,格式如下: + // NAME + // TLE1 + // TLE2 +} diff --git a/src/components/h-cesium-viewer/index.vue b/src/components/h-cesium-viewer/h-cesium-viewer.vue similarity index 100% rename from src/components/h-cesium-viewer/index.vue rename to src/components/h-cesium-viewer/h-cesium-viewer.vue diff --git a/src/pages/Satellite/Cesium/cesium-helper/_TOOLTIP_MAP.ts b/src/components/h-cesium-viewer/helper/_TOOLTIP_MAP.ts similarity index 100% rename from src/pages/Satellite/Cesium/cesium-helper/_TOOLTIP_MAP.ts rename to src/components/h-cesium-viewer/helper/_TOOLTIP_MAP.ts diff --git a/src/components/h-cesium-viewer/VIEWER_OPTIONS.ts b/src/components/h-cesium-viewer/helper/_VIEWER_OPTIONS.ts similarity index 100% rename from src/components/h-cesium-viewer/VIEWER_OPTIONS.ts rename to src/components/h-cesium-viewer/helper/_VIEWER_OPTIONS.ts diff --git a/src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.ts b/src/components/h-cesium-viewer/helper/configureCesium.ts similarity index 57% rename from src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.ts rename to src/components/h-cesium-viewer/helper/configureCesium.ts index bde03c3..6027b81 100644 --- a/src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.ts +++ b/src/components/h-cesium-viewer/helper/configureCesium.ts @@ -1,26 +1,6 @@ import * as Cesium from 'cesium'; -import { VIEWER_OPTIONS } from './00.cesium-init.VIEWER_OPTIONS'; - -import 'cesium/Build/Cesium/Widgets/widgets.css'; - -Cesium.Ion.defaultAccessToken = import.meta.env.VITE_CESIUM_ION_TOKEN; // 用了离线地图的情况是不需要的。 - -Object.assign(globalThis, { Cesium }); - -_configureCesium(); - -export function cesium_init(container: Element) { - const viewer = new Cesium.Viewer(container, VIEWER_OPTIONS()); - - viewer.scene.debugShowFramesPerSecond = true; - - initTimeLine(viewer); - - return viewer; -} - -function _configureCesium() { +export function configureCesium() { if (document.querySelector('#hide-cesium-viewer-bottom') === null) { document.head.append( Object.assign(document.createElement('style'), { @@ -64,15 +44,3 @@ function _configureCesium() { 60, // 北纬 ); } - -function initTimeLine(viewer: Cesium.Viewer, totalSeconds = /* 默认场景的时间跨度 */ 24 * 60 * 60) { - const start = Cesium.JulianDate.fromIso8601(new Date().toISOString()); - const stop = Cesium.JulianDate.addSeconds(start, totalSeconds, new Cesium.JulianDate()); - viewer.clock.startTime = start.clone(); - viewer.clock.stopTime = stop.clone(); - viewer.clock.currentTime = start.clone(); - viewer.timeline.zoomTo(start, stop); - viewer.clock.multiplier = 1; - viewer.clock.shouldAnimate = true; - viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP; -} diff --git a/src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.globe.ts b/src/components/h-cesium-viewer/helper/configureMapTile.ts similarity index 100% rename from src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.globe.ts rename to src/components/h-cesium-viewer/helper/configureMapTile.ts diff --git a/src/components/h-cesium-viewer/helper/configureTimeLine.ts b/src/components/h-cesium-viewer/helper/configureTimeLine.ts new file mode 100644 index 0000000..b989e32 --- /dev/null +++ b/src/components/h-cesium-viewer/helper/configureTimeLine.ts @@ -0,0 +1,20 @@ +import * as Cesium from 'cesium'; + +const 默认场景的时间跨度 = 2 * 60 * 60; // 2小时 + +export function configureTimeLine(viewer: Cesium.Viewer, totalSeconds = 默认场景的时间跨度) { + const start = Cesium.JulianDate.fromIso8601(new Date().toISOString()); + const stop = Cesium.JulianDate.addSeconds(start, totalSeconds, new Cesium.JulianDate()); + + // 设置时钟范围 + viewer.clock.startTime = start.clone(); + viewer.clock.stopTime = stop.clone(); + viewer.clock.currentTime = start.clone(); + viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP; + viewer.clock.multiplier = 30; // 30倍速播放 + + // 设置时间轴范围 + viewer.timeline.zoomTo(start, stop); + + viewer.clock.shouldAnimate = true; +} diff --git a/src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.VIEWER_OPTIONS.ts b/src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.VIEWER_OPTIONS.ts deleted file mode 100644 index 07955c8..0000000 --- a/src/pages/Satellite/Cesium/cesium-helper/00.cesium-init.VIEWER_OPTIONS.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { Viewer } from 'cesium'; - -import * as Cesium from 'cesium'; - -export const VIEWER_OPTIONS = (): Viewer.ConstructorOptions => { - return { - animation: true, // .cesium-viewer-animationContainer https://cesium.com/learn/ion-sdk/ref-doc/Animation.html - baseLayer: Cesium.ImageryLayer.fromProviderAsync( - Cesium.TileMapServiceImageryProvider.fromUrl(Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')), - ), - baseLayerPicker: false, - fullscreenButton: !true, // 全屏按钮 - geocoder: false, // = IonGeocodeProviderType.DEFAULT] - 在使用Geocoder小部件进行搜索时使用的地理编码服务或服务。如果设置为false,则不会创建Geocoder小部件。 - - // globe: false, // 地球 - homeButton: true, // Home按钮 - infoBox: false, // InfoBox小部件。 - navigationHelpButton: false, // 是否显示导航帮助按钮 - orderIndependentTranslucency: false, // 顺序无关透明度 - projectionPicker: !true, // 投影选择器 - requestRenderMode: !true, // 如果为真,渲染帧将仅在场景内部发生变化时需要时发生。启用此功能可以减少应用程序的CPU/GPU使用率,并在移动设备上节省更多电量,但在此模式下需要使用{@link Scene#requestRender}显式渲染新帧。在API的其他部分对场景进行更改后,在许多情况下都需要这样做。请参阅{@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|使用显式渲染提高性能}。 - sceneModePicker: true, // 是否显示场景模式选择器(2D/3D切换) - selectionIndicator: true, - shadows: true, // Determines if shadows are cast by light sources. - - /* animationContainer: !true, */ - /* timelineContainer: true, */ - /* bottomContainer: document.createElement('p'), // The DOM element or ID that will contain the bottomContainer. If not specified, the bottomContainer is added to the widget itself. */ - shouldAnimate: !true, - showRenderLoopErrors: true, // 如果为真,当发生渲染循环错误时,此小部件将自动向用户显示包含错误的HTML面板。 - timeline: true, - }; -}; diff --git a/src/pages/Satellite/Cesium/components/SatelliteSelector.vue b/src/pages/Satellite/Cesium/components/SatelliteSelector.vue deleted file mode 100644 index 4a69c45..0000000 --- a/src/pages/Satellite/Cesium/components/SatelliteSelector.vue +++ /dev/null @@ -1,170 +0,0 @@ - - - diff --git a/src/pages/Satellite/Cesium/index.page.vue b/src/pages/Satellite/Cesium/index.page.vue deleted file mode 100644 index cb03b57..0000000 --- a/src/pages/Satellite/Cesium/index.page.vue +++ /dev/null @@ -1,78 +0,0 @@ - - - diff --git a/src/pages/Satellite/SatNOGS/index.page.MD b/src/pages/Satellite/SatNOGS/index.page.MD deleted file mode 100644 index c5b8fe5..0000000 --- a/src/pages/Satellite/SatNOGS/index.page.MD +++ /dev/null @@ -1 +0,0 @@ -- https://satnogs.org diff --git a/src/pages/Satellite/Cesium/cesium-demos/_TLE_DATA.ts b/src/pages/_cesium-demos/_TLE_DATA.ts similarity index 100% rename from src/pages/Satellite/Cesium/cesium-demos/_TLE_DATA.ts rename to src/pages/_cesium-demos/_TLE_DATA.ts diff --git a/src/pages/Satellite/Cesium/cesium-demos/demo_01_OrbitGeneration.ts b/src/pages/_cesium-demos/demo_01_OrbitGeneration.ts similarity index 100% rename from src/pages/Satellite/Cesium/cesium-demos/demo_01_OrbitGeneration.ts rename to src/pages/_cesium-demos/demo_01_OrbitGeneration.ts diff --git a/src/pages/Satellite/Cesium/cesium-demos/demo_02_Track.ts b/src/pages/_cesium-demos/demo_02_Track.ts similarity index 88% rename from src/pages/Satellite/Cesium/cesium-demos/demo_02_Track.ts rename to src/pages/_cesium-demos/demo_02_Track.ts index 12688fd..a63a23b 100644 --- a/src/pages/Satellite/Cesium/cesium-demos/demo_02_Track.ts +++ b/src/pages/_cesium-demos/demo_02_Track.ts @@ -5,19 +5,26 @@ import { eciToEcf, gstime, propagate, twoline2satrec } from 'satellite.js'; /** * 未来2小时内每30秒的位置 */ -export async function demo_02_Track(viewer: Viewer) { - const tle = `STARLINK-11371 [DTC] +export async function demo_02_Track( + viewer: Viewer, + tle = `DEMO [测试] 1 62879U 25024A 25062.93300820 .00003305 00000+0 21841-4 0 9995 -2 62879 42.9977 257.3937 0001725 269.2925 90.7748 15.77864921 5143`; - +2 62879 42.9977 257.3937 0001725 269.2925 90.7748 15.77864921 5143`, +) { // 解析TLE数据 const lines = tle.split('\n') as [string, string, string]; const satelliteName = lines[0]?.trim(); const satrec = twoline2satrec(lines[1], lines[2]); + // 生成随机颜色 + const satelliteColor = Cesium.Color.fromRandom({ alpha: 1 }); + const pathColor = Cesium.Color.fromRandom({ alpha: 1 }); + const orbitColor = Cesium.Color.fromRandom({ alpha: 1 }); + const coverageColor = Cesium.Color.fromRandom({ alpha: 1 }); + // 创建卫星实体 const satelliteEntity = viewer.entities.add({ - id: 'STARLINK-11371', + id: `${satelliteName}-satellite`, label: { fillColor: Cesium.Color.WHITE, font: '14pt sans-serif', @@ -28,11 +35,11 @@ export async function demo_02_Track(viewer: Viewer) { text: satelliteName, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, }, - name: 'STARLINK-11371', + name: `${satelliteName} Satellite`, // 卫星轨迹 path: { material: new Cesium.PolylineGlowMaterialProperty({ - color: Cesium.Color.BLUE, + color: pathColor, glowPower: 0.2, }), resolution: 1, @@ -40,7 +47,7 @@ export async function demo_02_Track(viewer: Viewer) { }, // 使用简单点图形表示卫星 point: { - color: Cesium.Color.YELLOW, + color: satelliteColor, outlineColor: Cesium.Color.WHITE, outlineWidth: 2, pixelSize: 10, @@ -102,12 +109,12 @@ export async function demo_02_Track(viewer: Viewer) { // 添加完整轨道线 viewer.entities.add({ - id: 'STARLINK-11371-orbit', - name: 'STARLINK-11371 Full Orbit', + id: `${satelliteName}-orbit`, + name: `${satelliteName} Full Orbit`, polyline: { clampToGround: false, material: new Cesium.PolylineDashMaterialProperty({ - color: Cesium.Color.CYAN, + color: orbitColor, dashLength: 8, }), positions: orbitPositions, @@ -129,9 +136,9 @@ export async function demo_02_Track(viewer: Viewer) { // 创建覆盖范围实体 viewer.entities.add({ ellipsoid: { - material: Cesium.Color.BLUE.withAlpha(0.2), + material: coverageColor.withAlpha(0.2), outline: true, - outlineColor: Cesium.Color.BLUE.withAlpha(0.8), + outlineColor: coverageColor.withAlpha(0.8), radii: new Cesium.CallbackProperty(() => { const position = satelliteEntity.position?.getValue(viewer.clock.currentTime); if (!position) return new Cesium.Cartesian3(10_000, 10_000, 10_000); @@ -149,8 +156,8 @@ export async function demo_02_Track(viewer: Viewer) { slicePartitions: 24, stackPartitions: 16, }, - id: 'STARLINK-11371-coverage', - name: 'STARLINK-11371 Coverage', + id: `${satelliteName}-coverage`, + name: `${satelliteName} Coverage`, orientation: new Cesium.CallbackProperty(() => { // 确保椭球体始终指向地球中心 const position = satelliteEntity.position?.getValue(viewer.clock.currentTime); @@ -169,9 +176,9 @@ export async function demo_02_Track(viewer: Viewer) { ellipse: { granularity: Cesium.Math.toRadians(1), height: 0, - material: Cesium.Color.BLUE.withAlpha(0.2), + material: coverageColor.withAlpha(0.2), outline: true, - outlineColor: Cesium.Color.BLUE.withAlpha(0.8), + outlineColor: coverageColor.withAlpha(0.8), outlineWidth: 2, semiMajorAxis: new Cesium.CallbackProperty(() => { const satPosition = satelliteEntity.position?.getValue(viewer.clock.currentTime); @@ -192,8 +199,8 @@ export async function demo_02_Track(viewer: Viewer) { return cartographic.height * Math.tan(Cesium.Math.toRadians(coverageAngle)); }, false), }, - id: 'STARLINK-11371-ground-coverage', - name: 'STARLINK-11371 Ground Coverage', + id: `${satelliteName}-coverage-ground`, + name: `${satelliteName} Ground Coverage`, position: new Cesium.CallbackPositionProperty(() => { const satPosition = satelliteEntity.position?.getValue(viewer.clock.currentTime); if (!satPosition) return new Cesium.Cartesian3(); @@ -208,7 +215,7 @@ export async function demo_02_Track(viewer: Viewer) { // - https://github.com/CesiumGS/cesium/issues/8900#issuecomment-638114149 // - which is normal from a bird's eye view. But after setting it as the trackedEntity, it behaves abnormally. // 设置相机自动跟踪卫星 - viewer.trackedEntity = satelliteEntity; + // viewer.trackedEntity = satelliteEntity; // 开始动画 viewer.clock.shouldAnimate = true; diff --git a/src/pages/Satellite/Cesium/cesium-demos/demo_03_卫星加站点.ts b/src/pages/_cesium-demos/demo_03_卫星加站点.ts similarity index 100% rename from src/pages/Satellite/Cesium/cesium-demos/demo_03_卫星加站点.ts rename to src/pages/_cesium-demos/demo_03_卫星加站点.ts diff --git a/src/pages/Satellite/Cesium/cesium-helper/SatelliteEntity.ts b/src/pages/_cesium-demos/归档/SatelliteEntity.ts similarity index 100% rename from src/pages/Satellite/Cesium/cesium-helper/SatelliteEntity.ts rename to src/pages/_cesium-demos/归档/SatelliteEntity.ts diff --git a/typed-router.d.ts b/typed-router.d.ts index acfcfdf..ee7b778 100644 --- a/typed-router.d.ts +++ b/typed-router.d.ts @@ -33,7 +33,6 @@ declare module 'vue-router/auto-routes' { 'PageStyle': RouteRecordInfo<'PageStyle', '/Page/Style', Record, Record>, 'PkgsUsageI18n': RouteRecordInfo<'PkgsUsageI18n', '/PkgsUsage/I18n', Record, Record>, 'PkgsUsageTsEnumUtil': RouteRecordInfo<'PkgsUsageTsEnumUtil', '/PkgsUsage/ts-enum-util', Record, Record>, - 'SatelliteCesium': RouteRecordInfo<'SatelliteCesium', '/Satellite/Cesium', Record, Record>, 'UIComponentsAntdV': RouteRecordInfo<'UIComponentsAntdV', '/UI-components/AntdV', Record, Record>, 'UIComponentsComponents': RouteRecordInfo<'UIComponentsComponents', '/UI-components/Components', Record, Record>, 'UIComponentsInfiniteLoading': RouteRecordInfo<'UIComponentsInfiniteLoading', '/UI-components/infinite-loading', Record, Record>,