From 171a5597caa5887da782db59ca4ab643b163b84d Mon Sep 17 00:00:00 2001
From: husq <931347610@qq.com>
Date: Sat, 28 Oct 2023 20:52:52 +0800
Subject: [PATCH] 实施航线逻辑修改、页面修改
---
src/hooks/use-cesium-tsa.ts | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/hooks/use-cesium-tsa.ts b/src/hooks/use-cesium-tsa.ts
index d70dfcf..6f6d60d 100644
--- a/src/hooks/use-cesium-tsa.ts
+++ b/src/hooks/use-cesium-tsa.ts
@@ -20,11 +20,17 @@
outlineWidth: number,
[key: string]: any
}
+interface polyline {
+ width?: number
+ material?: Cesium.Color
+ [key: string]: any
+}
interface pointOption {
longitude: number
latitude: number
point?: pointSetting
billboard?: billboardSetting
+ polyline?: polyline
label?: labelSetting
id?: string
heading?: number
@@ -153,6 +159,14 @@
})
}
+ // 添加线段
+ const addPolyline = (pointOption: pointOption) => {
+ viewer?.entities.add({
+ polyline: pointOption.polyline,
+ id: pointOption.id,
+ })
+ }
+
// 通过点ID删除
function removeById (id:string) {
viewer?.entities.removeById(id)
@@ -276,6 +290,7 @@
roadPattern,
patternMap,
getEntityById,
- updateEntityPosition
+ updateEntityPosition,
+ addPolyline
}
}
--
Gitblit v1.9.3