feat: 整理 HCesiumViewerCls 相关
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 3m10s
/ lint-build-and-check (push) Successful in 4m25s
/ surge (push) Successful in 2m42s
/ playwright (push) Successful in 5m15s

This commit is contained in:
严浩
2025-03-31 20:43:13 +08:00
parent 4636f9fde4
commit 2c6a4287d2
3 changed files with 15 additions and 43 deletions

View File

@ -3,7 +3,6 @@ import * as Cesium from 'cesium';
import { VIEWER_OPTIONS_FN } from './VIEWER_OPTIONS';
export interface GroundStationOptions {
// 调整顺序以符合 ESLint 规则
color?: Cesium.Color; // 点的可选颜色
height?: number; // 可选高度默认为0
id: string; // 站点的唯一标识符
@ -27,19 +26,16 @@ export class HCesiumViewerCls {
/**
* 向视图中添加地面站实体
* @param options - 地面站的选项参数
* @returns 添加的实体对象,如果视图未初始化则返回 undefined
* @returns 添加的实体对象
*/
addGroundStation(options: GroundStationOptions): Cesium.Entity | undefined {
addGroundStation(options: GroundStationOptions): Cesium.Entity {
if (!this.viewer) {
console.error('视图未初始化。请先调用 initCesiumViewer 方法。');
return;
throw new Error('视图未初始化。请先调用 initCesiumViewer 方法。');
}
const {
// 调整解构赋值顺序
// color = Cesium.Color.RED, // 默认颜色 - 已移除,将使用随机颜色
height = 0, // 如果未提供默认高度为0
id, // 获取 id
id,
latitude,
longitude,
name,