chbim-time-axis-v2 0.0.16 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -216,6 +216,66 @@ interface InstantTask extends GanttTask {
|
|
|
216
216
|
}
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
+
## 🎥 ViewportRoam (视角漫游)
|
|
220
|
+
|
|
221
|
+
组件包内置了一个 `ViewportRoam` 工具类,用于在 Cesium 中实现平滑的视角漫游,支持位置、偏航角(heading)、俯仰角(pitch)和翻滚角(roll)的插值动画。
|
|
222
|
+
|
|
223
|
+
### 1. 导入与定义
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
import { ViewportRoam, type RoamPoint } from "chbim-time-axis-v2";
|
|
227
|
+
|
|
228
|
+
// 漫游点数据结构
|
|
229
|
+
interface RoamPoint {
|
|
230
|
+
id: number | string;
|
|
231
|
+
time: string; // ISO8601 时间字符串
|
|
232
|
+
lng: number; // 经度
|
|
233
|
+
lat: number; // 纬度
|
|
234
|
+
alt: number; // 高度
|
|
235
|
+
heading: number; // 偏航角 (度)
|
|
236
|
+
pitch: number; // 俯仰角 (度)
|
|
237
|
+
roll?: number; // 翻滚角 (度),可选
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### 2. 使用示例
|
|
242
|
+
|
|
243
|
+
```typescript
|
|
244
|
+
// 1. 准备漫游数据
|
|
245
|
+
const roamData: RoamPoint[] = [
|
|
246
|
+
{
|
|
247
|
+
id: 1,
|
|
248
|
+
time: "2023-01-01T10:00:00Z",
|
|
249
|
+
lng: 120.123,
|
|
250
|
+
lat: 30.456,
|
|
251
|
+
alt: 100,
|
|
252
|
+
heading: 0,
|
|
253
|
+
pitch: -45,
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: 2,
|
|
257
|
+
time: "2023-01-01T10:01:00Z",
|
|
258
|
+
lng: 120.124,
|
|
259
|
+
lat: 30.457,
|
|
260
|
+
alt: 120,
|
|
261
|
+
heading: 90,
|
|
262
|
+
pitch: -30,
|
|
263
|
+
},
|
|
264
|
+
];
|
|
265
|
+
|
|
266
|
+
// 2. 初始化漫游控制器
|
|
267
|
+
const roamController = new ViewportRoam(viewer, roamData);
|
|
268
|
+
|
|
269
|
+
// 3. 开始漫游 (将自动监听时钟 tick 事件并更新相机)
|
|
270
|
+
roamController.start();
|
|
271
|
+
|
|
272
|
+
// 4. 停止漫游
|
|
273
|
+
// roamController.stop();
|
|
274
|
+
|
|
275
|
+
// 5. 销毁 (组件卸载时调用)
|
|
276
|
+
// roamController.destroy();
|
|
277
|
+
```
|
|
278
|
+
|
|
219
279
|
## ⚙️ 组件 API
|
|
220
280
|
|
|
221
281
|
### Props (属性)
|
|
@@ -12785,7 +12785,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12785
12785
|
clock: {},
|
|
12786
12786
|
tasks: {}
|
|
12787
12787
|
},
|
|
12788
|
-
emits: ["taskUpdate", "update:tasks", "add", "delete", "task-enter", "task-leave"],
|
|
12788
|
+
emits: ["taskUpdate", "update:tasks", "add", "delete", "task-enter", "task-leave", "blockUpdate"],
|
|
12789
12789
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
12790
12790
|
const slots = useSlots();
|
|
12791
12791
|
const props = __props;
|
|
@@ -13255,6 +13255,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
13255
13255
|
if (t.blocks && t.blocks[payload.blockIndex]) {
|
|
13256
13256
|
t.blocks[payload.blockIndex].startTime = payload.startTime;
|
|
13257
13257
|
t.blocks[payload.blockIndex].endTime = payload.endTime;
|
|
13258
|
+
emit("blockUpdate", {
|
|
13259
|
+
task: JSON.parse(JSON.stringify(t)),
|
|
13260
|
+
block: JSON.parse(JSON.stringify(t.blocks[payload.blockIndex])),
|
|
13261
|
+
index: payload.blockIndex
|
|
13262
|
+
});
|
|
13258
13263
|
emit("taskUpdate", JSON.parse(JSON.stringify(t)));
|
|
13259
13264
|
return true;
|
|
13260
13265
|
}
|
|
@@ -13628,8 +13633,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
13628
13633
|
};
|
|
13629
13634
|
}
|
|
13630
13635
|
});
|
|
13631
|
-
const
|
|
13632
|
-
const CesiumGantt = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
13636
|
+
const CesiumGantt_vue_vue_type_style_index_0_scoped_bc47a9ac_lang = "";
|
|
13637
|
+
const CesiumGantt = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bc47a9ac"]]);
|
|
13633
13638
|
CesiumGantt.install = (app) => {
|
|
13634
13639
|
app.component("CesiumGantt", CesiumGantt);
|
|
13635
13640
|
};
|