sat-earth 0.5.1 → 0.6.1

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
@@ -1,5 +1,56 @@
1
1
  ## 什么是快乐“星球” ?
2
-   [SatEarth](https://gitee.com/gengkaibo/sat-earth)是基于 [Mars3D](http://mars3d.cn/) 和 [Cesium](https://cesium.com/) 的底层API,实现的一个开源三维地球组件库,目的是支持开发人员快速搭建三维场景,目前尚在搭建中,后续会封装符合扩展性、通用性、健壮性的组件,以及完善guide文档。
2
+   [SatEarth](https://gitee.com/gengkaibo/sat-earth)是一个三维地球组件库,目的是支持开发人员快速搭建三维场景。
3
+
4
+ ## 组件库亮点
5
+ - 内置丰富基础功能组件以及菜单组件,如果不需要定制化开发,可以分分钟出一个平台级应用系统
6
+ - 对外暴露API,可随意调用sat-earth、mars3d、cesium API 进行定制化开发
7
+ - 功能组件可配合菜单组件也可独立运行,兼顾灵活与便捷
8
+ - 对样式进行了友好的移动端适配,兼顾大屏与小屏视觉体验
9
+ - ...
10
+
11
+ ## 当前开发进度
12
+ - 1.数据源 (done)
13
+ - 2.地图部件 (done)
14
+ - 坐标信息
15
+ - 悬浮导航
16
+ - 时钟动画
17
+ - 鹰眼地图
18
+ - 3.工具栏
19
+ - 3.1.搜索定位(done)
20
+ - 地名检索
21
+ - 坐标定位
22
+ - 路径规划
23
+ - 3.2.量测工具(done)
24
+ - 坐标测量
25
+ - 空间距离
26
+ - 水平面积
27
+ - 高度测量
28
+ - 三角测量
29
+ - 方位测量
30
+ - 贴地距离
31
+ - 贴地面积
32
+ - 3.3.图上标绘(done)
33
+ - 3.4.出图工具(done)
34
+ - 3.5.空间分析
35
+ - 剖面分析
36
+ - 方量分析
37
+ - 通视分析
38
+ - 可视域分析
39
+ - 限高分析
40
+ - 缓冲分析
41
+ - 剖面分析
42
+ - 3.6.地形分析
43
+ - 挖地分析
44
+ - 等高线分析
45
+ - 坡度坡向分析
46
+ - 淹没分析
47
+ - 3.7.模型分析
48
+ - 淹没分析
49
+ - 模型压平
50
+ - 模型裁剪
51
+ - 模型剖切
52
+ - 3.8.视频融合
53
+ - 3.9.飞行漫游
3
54
 
4
55
  ## 前序准备
5
56
  - [node](http://nodejs.org/) 和 [git](https://git-scm.com/) - 项目开发环境
@@ -10,7 +61,7 @@
10
61
  - [Cesium](https://cesium.com/) - Cesium是一个开源的,基于webgl的二、三维地图引擎
11
62
  - [Mars3D](http://mars3d.cn/) - 基于Cesium优化提升与B/S架构设计,支持多行业扩展的轻量级高效能GIS开发平台
12
63
 
13
- ## 尝鲜
64
+ ## 安装
14
65
  - 首先在命令行执行如下命令添加 `sat-earth` 的依赖
15
66
  ```bash
16
67
  npm i sat-earth
@@ -77,7 +128,7 @@ export default defineConfig({
77
128
 
78
129
  ```
79
130
 
80
- - 在`tsconfig.json`中引入类型声明文件`sat-earth/dist/packages/auto-components`,来支持[Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)的代码提示功能
131
+ - 在`tsconfig.json`中的`types`加入类型声明文件`sat-earth/dist/packages/auto-components`,来支持[Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)的类型提示
81
132
  ```json
82
133
  {
83
134
  "compilerOptions": {
@@ -118,7 +169,7 @@ export default defineConfig({
118
169
  }
119
170
  ```
120
171
 
121
- - 开始使用
172
+ ## 快速开始
122
173
  ```ts
123
174
  <script setup lang="ts">
124
175
  import { satMapTypes, type SatMenu_Type_MenuItem } from 'sat-earth'
@@ -315,77 +366,3 @@ body {
315
366
  </style>
316
367
 
317
368
  ```
318
- ## 菜单计划
319
- - 1.数据源 (done)
320
- - 2.地图部件 (done)
321
- - 坐标信息
322
- - 悬浮导航
323
- - 时钟动画
324
- - 鹰眼地图
325
- - 3.工具栏
326
- - 3.1.搜索定位(done)
327
- - 地名检索
328
- - 坐标定位
329
- - 路径规划
330
- - 3.2.量测工具(done)
331
- - 坐标测量
332
- - 空间距离
333
- - 水平面积
334
- - 高度测量
335
- - 三角测量
336
- - 方位测量
337
- - 贴地距离
338
- - 贴地面积
339
- - 3.3.图上标绘(done)
340
- - 3.4.出图工具(done)
341
- - 3.5.空间分析
342
- - 剖面分析
343
- - 方量分析
344
- - 通视分析
345
- - 可视域分析
346
- - 限高分析
347
- - 缓冲分析
348
- - 剖面分析
349
- - 3.6.地形分析
350
- - 挖地分析
351
- - 等高线分析
352
- - 坡度坡向分析
353
- - 淹没分析
354
- - 3.7.模型分析
355
- - 淹没分析
356
- - 模型压平
357
- - 模型裁剪
358
- - 模型剖切
359
- - 3.8.视频融合
360
- - 4.模拟仿真
361
- - 4.1.飞行漫游
362
- - 4.2.曲率弹道
363
-
364
- ## 其他说明
365
- 这是我第一次搭建组件库,目前状态是有时间就会写点儿,平时还要工作,所以无法保证开发进度,当然有一部分原因其实是把这次搭建组件库作为一种学习方式。如果您有什么问题或者见解欢迎指正和讨论。微信号:`KaiboGeng`
366
-
367
- ## 如何贡献
368
- 你可以[提一个 issue](https://gitee.com/gengkaibo/sat-earth/issues) 或者提交一个 Pull Request。
369
-
370
- #### Pull Request
371
-
372
- 1. Fork 代码!
373
- 2. 创建自己的分支: `git checkout -b feat/xxxx`
374
- 3. 提交你的修改: `git commit -am 'feat(function): add xxxxx'`
375
- 4. 推送您的分支: `git push origin feat/xxxx`
376
- 5. 提交`pull request`
377
-
378
- #### Git 贡献提交规范,参考 [vue](https://github.com/vuejs/vue/blob/dev/.github/COMMIT_CONVENTION.md) 规范
379
- - `feat` 增加新功能
380
- - `fix` 修复问题/BUG
381
- - `style` 代码风格相关无影响运行结果的
382
- - `perf` 优化/性能提升
383
- - `refactor` 重构
384
- - `polish` 修改
385
- - `revert` 撤销修改
386
- - `test` 测试相关
387
- - `docs` 文档/注释
388
- - `chore` 依赖更新/脚手架配置修改等
389
- - `workflow` 工作流改进
390
- - `ci` 持续集成
391
- - `types` 类型定义文件更改
@@ -37,8 +37,8 @@ export declare class Plot {
37
37
  startEditGraphic(item: PlotGroupTree): void;
38
38
  startEditGraphicById(id: string | number): void;
39
39
  getActiveGroupName(): any;
40
- downloadJson(filename: any, target?: any): void;
41
- downloadKml(filename: any, target: any): void;
40
+ downloadJson(filename: string, target?: any): void;
41
+ downloadKml(filename: string, target: any): void;
42
42
  toKml(target: any): any;
43
43
  destroy(): void;
44
44
  }
@@ -16316,7 +16316,9 @@ class v_ {
16316
16316
  const n = Fa(a);
16317
16317
  if (!this.map.getLayerById((o = n.id) != null ? o : "")) {
16318
16318
  const s = Ue.LayerUtil.create(n);
16319
- this.map.addLayer(s), y_(this, a);
16319
+ this.map.addLayer(s).then(() => {
16320
+ y_(this, a);
16321
+ });
16320
16322
  }
16321
16323
  }), t.length) {
16322
16324
  const a = Co();
@@ -16423,7 +16425,11 @@ class v_ {
16423
16425
  }
16424
16426
  createSplitLayer(t) {
16425
16427
  let a = null;
16426
- return t && (a = Ue.LayerUtil.create(t.toJSON()), a.id = t.id + "_split_" + Sa(), a._isSplit = !0), a;
16428
+ if (t) {
16429
+ const n = t.toJSON();
16430
+ n.zIndex = void 0, a = Ue.LayerUtil.create(n), a.id = t.id + "_split_" + Sa(), a._isSplit = !0;
16431
+ }
16432
+ return a;
16427
16433
  }
16428
16434
  }
16429
16435
  function y_(e, t) {
@@ -17040,10 +17046,8 @@ function M_(e, t) {
17040
17046
  e.addControl(a), R.barInsertInitialIndex++;
17041
17047
  }
17042
17048
  function I_(e, t) {
17043
- t != null && t.enable && e.openFlyAnimation({
17044
- callback: () => {
17045
- t.callback();
17046
- }
17049
+ t != null && t.enable && e.openFlyAnimation().then(() => {
17050
+ t.callback();
17047
17051
  });
17048
17052
  }
17049
17053
  function L_(e, t) {
@@ -17378,7 +17382,7 @@ const rt = "sat-base-layers-default", dl = "sat-auxiliary-layers-default", On =
17378
17382
  },
17379
17383
  unActiveAll() {
17380
17384
  for (const e in this.$state)
17381
- this.$state[e].active = !1;
17385
+ this.$state[e] && (this.$state[e].active = !1);
17382
17386
  }
17383
17387
  },
17384
17388
  getters: {
@@ -17621,7 +17625,7 @@ const iE = { class: "sat-panel-content" }, uE = { class: "sat-panel-content-head
17621
17625
  ], 6));
17622
17626
  }
17623
17627
  });
17624
- const kt = /* @__PURE__ */ Ke(fE, [["__scopeId", "data-v-c85d026a"]]), Bd = (e) => (xt("data-v-ad71f0e7"), e = e(), Nt(), e), pE = { class: "camera-bookmark-form" }, mE = /* @__PURE__ */ Bd(() => /* @__PURE__ */ B("i", {
17628
+ const kt = /* @__PURE__ */ Ke(fE, [["__scopeId", "data-v-c85d026a"]]), Bd = (e) => (xt("data-v-71b8f04f"), e = e(), Nt(), e), pE = { class: "camera-bookmark-form" }, mE = /* @__PURE__ */ Bd(() => /* @__PURE__ */ B("i", {
17625
17629
  title: "\u8FC7\u6EE4",
17626
17630
  class: "fa fa-filter",
17627
17631
  "aria-hidden": "true"
@@ -17655,15 +17659,14 @@ const kt = /* @__PURE__ */ Ke(fE, [["__scopeId", "data-v-c85d026a"]]), Bd = (e)
17655
17659
  }
17656
17660
  R.map.expImage({
17657
17661
  download: !1,
17658
- width: 300,
17659
- callback(d) {
17660
- o.value.unshift({
17661
- id: Sa(),
17662
- name: l.value,
17663
- center: R.map.getCameraView(),
17664
- image: d
17665
- }), l.value = "", Mt.LocalStorage.set(Yl, o.value);
17666
- }
17662
+ width: 300
17663
+ }).then((d) => {
17664
+ o.value.unshift({
17665
+ id: Sa(),
17666
+ name: l.value,
17667
+ center: R.map.getCameraView(),
17668
+ image: d.image
17669
+ }), l.value = "", Mt.LocalStorage.set(Yl, o.value);
17667
17670
  });
17668
17671
  }, i = () => {
17669
17672
  l.value ? o.value = o.value.filter((g) => g.name.indexOf(l.value) > -1) : o.value = Mt.LocalStorage.get(Yl);
@@ -17735,7 +17738,7 @@ const kt = /* @__PURE__ */ Ke(fE, [["__scopeId", "data-v-c85d026a"]]), Bd = (e)
17735
17738
  };
17736
17739
  }
17737
17740
  });
17738
- const _E = /* @__PURE__ */ Ke(wE, [["__scopeId", "data-v-ad71f0e7"]]), EE = {
17741
+ const _E = /* @__PURE__ */ Ke(wE, [["__scopeId", "data-v-71b8f04f"]]), EE = {
17739
17742
  class: /* @__PURE__ */ T(["sat-globe"])
17740
17743
  }, SE = ["id"], FE = {
17741
17744
  name: "SatGlobe"
@@ -20324,7 +20327,7 @@ function ck(e, t = "base64ToFile") {
20324
20327
  s[o] = l.charCodeAt(o);
20325
20328
  return new File([s], t, { type: n });
20326
20329
  }
20327
- const dk = (e) => (xt("data-v-a2e1cc24"), e = e(), Nt(), e), fk = { class: "drawing-container" }, pk = /* @__PURE__ */ dk(() => /* @__PURE__ */ B("div", { id: "tui-image-editor" }, null, -1)), mk = { class: "custom-btn-eara" }, gk = /* @__PURE__ */ Ae(" \u573A\u666F\u66F4\u65B0 "), hk = /* @__PURE__ */ Ae(" \u63D2\u5165 "), vk = /* @__PURE__ */ Ae(" \u4FDD\u5B58 "), yk = {
20330
+ const dk = (e) => (xt("data-v-47ba3d63"), e = e(), Nt(), e), fk = { class: "drawing-container" }, pk = /* @__PURE__ */ dk(() => /* @__PURE__ */ B("div", { id: "tui-image-editor" }, null, -1)), mk = { class: "custom-btn-eara" }, gk = /* @__PURE__ */ Ae(" \u573A\u666F\u66F4\u65B0 "), hk = /* @__PURE__ */ Ae(" \u63D2\u5165 "), vk = /* @__PURE__ */ Ae(" \u4FDD\u5B58 "), yk = {
20328
20331
  name: "TheImageEditor"
20329
20332
  }, bk = /* @__PURE__ */ Y({
20330
20333
  ...yk,
@@ -20337,7 +20340,16 @@ const dk = (e) => (xt("data-v-a2e1cc24"), e = e(), Nt(), e), fk = { class: "draw
20337
20340
  path: r,
20338
20341
  name: "image"
20339
20342
  },
20340
- menu: ["resize", "crop", "rotate", "draw", "shape", "icon", "text", "filter"],
20343
+ menu: [
20344
+ "resize",
20345
+ "crop",
20346
+ "rotate",
20347
+ "draw",
20348
+ "shape",
20349
+ "icon",
20350
+ "text",
20351
+ "filter"
20352
+ ],
20341
20353
  initMenu: "filter",
20342
20354
  menuBarPosition: "bottom",
20343
20355
  locale: uk
@@ -20348,9 +20360,9 @@ const dk = (e) => (xt("data-v-a2e1cc24"), e = e(), Nt(), e), fk = { class: "draw
20348
20360
  }, l = () => {
20349
20361
  R.map.expImage({
20350
20362
  download: !1,
20351
- callback: (r, i) => {
20352
- t == null || t.loadImageFromFile(ck(r));
20353
- }
20363
+ encoderOptions: 1
20364
+ }).then((r) => {
20365
+ t == null || t.loadImageFromFile(ck(r.image));
20354
20366
  });
20355
20367
  }, o = (r) => {
20356
20368
  if (r != null && r.raw) {
@@ -20374,9 +20386,9 @@ const dk = (e) => (xt("data-v-a2e1cc24"), e = e(), Nt(), e), fk = { class: "draw
20374
20386
  return we(() => {
20375
20387
  R.map.expImage({
20376
20388
  download: !1,
20377
- callback: (r, i) => {
20378
- n(r);
20379
- }
20389
+ encoderOptions: 1
20390
+ }).then((r) => {
20391
+ n(r.image);
20380
20392
  });
20381
20393
  }), Gt(() => {
20382
20394
  t == null || t.destroy(), t = null;
@@ -20431,7 +20443,7 @@ const dk = (e) => (xt("data-v-a2e1cc24"), e = e(), Nt(), e), fk = { class: "draw
20431
20443
  };
20432
20444
  }
20433
20445
  });
20434
- const Ck = /* @__PURE__ */ Ke(bk, [["__scopeId", "data-v-a2e1cc24"]]), wk = {
20446
+ const Ck = /* @__PURE__ */ Ke(bk, [["__scopeId", "data-v-47ba3d63"]]), wk = {
20435
20447
  name: "SatPicture"
20436
20448
  }, _k = /* @__PURE__ */ Y({
20437
20449
  ...wk,
@@ -25085,7 +25097,7 @@ const Yk = /* @__PURE__ */ Ke(Wk, [["__scopeId", "data-v-0d1e51ef"]]), Ro = (e)
25085
25097
  };
25086
25098
  }
25087
25099
  });
25088
- const sB = /* @__PURE__ */ Ke(oB, [["__scopeId", "data-v-c495e0c2"]]), rB = (e) => (xt("data-v-99f145dd"), e = e(), Nt(), e), iB = { class: "plot-edit-coord" }, uB = /* @__PURE__ */ rB(() => /* @__PURE__ */ B("div", { class: "plot-edit-coord-top" }, " \u5750\u6807\u4FE1\u606F ", -1)), cB = { class: "coordinates-operate" }, dB = ["onClick"], fB = ["onClick"], pB = {
25100
+ const sB = /* @__PURE__ */ Ke(oB, [["__scopeId", "data-v-c495e0c2"]]), rB = (e) => (xt("data-v-64e1dde1"), e = e(), Nt(), e), iB = { class: "plot-edit-coord" }, uB = /* @__PURE__ */ rB(() => /* @__PURE__ */ B("div", { class: "plot-edit-coord-top" }, " \u5750\u6807\u4FE1\u606F ", -1)), cB = { class: "coordinates-operate" }, dB = ["onClick"], fB = ["onClick"], pB = {
25089
25101
  name: "PlotEditCoord"
25090
25102
  }, mB = /* @__PURE__ */ Y({
25091
25103
  ...pB,
@@ -25269,7 +25281,7 @@ const sB = /* @__PURE__ */ Ke(oB, [["__scopeId", "data-v-c495e0c2"]]), rB = (e)
25269
25281
  };
25270
25282
  }
25271
25283
  });
25272
- const gB = /* @__PURE__ */ Ke(mB, [["__scopeId", "data-v-99f145dd"]]);
25284
+ const gB = /* @__PURE__ */ Ke(mB, [["__scopeId", "data-v-64e1dde1"]]);
25273
25285
  const hB = { class: "plot-edit-style" }, vB = { class: "plot-edit-style-template" }, yB = ["data-type"], bB = { class: "plot-style-title" }, CB = { class: "plot-style-content" }, wB = { key: 1 }, _B = ["data-type"], EB = { class: "plot-style-title" }, SB = { class: "plot-style-content" }, FB = {
25274
25286
  name: "PlotEditStyle"
25275
25287
  }, kB = /* @__PURE__ */ Y({