feat: 整理 HCesiumViewerCls 相关
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user