sat-earth 0.8.41 → 0.9.0

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.
Files changed (91) hide show
  1. package/README.md +241 -2
  2. package/dist/packages/components/_private/TheImageEditor/index.d.ts +12 -12
  3. package/dist/packages/components/_private/TheImageEditor/index.vue.d.ts +49 -49
  4. package/dist/packages/components/analysis-model/SatModelAnalysis.vue.d.ts +170 -170
  5. package/dist/packages/components/analysis-model/index.d.ts +172 -172
  6. package/dist/packages/components/analysis-spatial/SatSpatialAnalysis.vue.d.ts +182 -182
  7. package/dist/packages/components/analysis-spatial/SatSpatialAnalysisMain.vue.d.ts +13 -13
  8. package/dist/packages/components/analysis-spatial/index.d.ts +184 -184
  9. package/dist/packages/components/analysis-spatial/modules/AnalysisSection.vue.d.ts +9 -9
  10. package/dist/packages/components/analysis-terrain/SatTerrainAnalysis.vue.d.ts +170 -170
  11. package/dist/packages/components/analysis-terrain/index.d.ts +172 -172
  12. package/dist/packages/components/globe/CameraBookmarkPanel.vue.d.ts +184 -185
  13. package/dist/packages/components/globe/MapSplitPanel.vue.d.ts +23 -26
  14. package/dist/packages/components/globe/SatGlobe.vue.d.ts +300 -302
  15. package/dist/packages/components/globe/helpers.d.ts +1 -2
  16. package/dist/packages/components/globe/index.d.ts +303 -305
  17. package/dist/packages/components/location/SatCoordinate.vue.d.ts +392 -392
  18. package/dist/packages/components/location/SatLocation.vue.d.ts +637 -637
  19. package/dist/packages/components/location/SatLocationMain.vue.d.ts +468 -468
  20. package/dist/packages/components/location/SatPathPlan.vue.d.ts +47 -47
  21. package/dist/packages/components/location/SatPoiQuery.vue.d.ts +29 -29
  22. package/dist/packages/components/location/index.d.ts +639 -639
  23. package/dist/packages/components/location/useCoordinate.d.ts +11 -11
  24. package/dist/packages/components/location/usePathPlan.d.ts +24 -24
  25. package/dist/packages/components/location/usePoiQuery.d.ts +13 -13
  26. package/dist/packages/components/map-part/SatMapPart.vue.d.ts +183 -181
  27. package/dist/packages/components/map-part/SatMapPartMain.vue.d.ts +15 -13
  28. package/dist/packages/components/map-part/index.d.ts +185 -183
  29. package/dist/packages/components/measure/SatMeasure.vue.d.ts +193 -193
  30. package/dist/packages/components/measure/SatMeasureMain.vue.d.ts +24 -24
  31. package/dist/packages/components/measure/index.d.ts +195 -195
  32. package/dist/packages/components/menu/SatMenu.vue.d.ts +130 -130
  33. package/dist/packages/components/menu/SatMenuMain.vue.d.ts +126 -126
  34. package/dist/packages/components/menu/tree/SatMenuTree.vue.d.ts +86 -86
  35. package/dist/packages/components/menu/tree/index.d.ts +86 -86
  36. package/dist/packages/components/panel/SatPanel.vue.d.ts +153 -153
  37. package/dist/packages/components/panel/index.d.ts +153 -153
  38. package/dist/packages/components/picture/SatPicture.vue.d.ts +219 -219
  39. package/dist/packages/components/picture/index.d.ts +224 -224
  40. package/dist/packages/components/plot/PlotEdit.vue.d.ts +79 -79
  41. package/dist/packages/components/plot/PlotEditAttr.vue.d.ts +23 -23
  42. package/dist/packages/components/plot/PlotEditCoord.vue.d.ts +29 -29
  43. package/dist/packages/components/plot/PlotEditStyle.vue.d.ts +23 -23
  44. package/dist/packages/components/plot/PlotGroup.vue.d.ts +909 -909
  45. package/dist/packages/components/plot/PlotSourceList.vue.d.ts +37 -37
  46. package/dist/packages/components/plot/SatPlot.vue.d.ts +1262 -1262
  47. package/dist/packages/components/plot/SatPlotMain.vue.d.ts +1079 -1079
  48. package/dist/packages/components/plot/helpers.d.ts +11 -11
  49. package/dist/packages/components/plot/index.d.ts +1264 -1264
  50. package/dist/packages/components/roam/SatRoam.vue.d.ts +170 -170
  51. package/dist/packages/components/roam/index.d.ts +172 -172
  52. package/dist/packages/components/source/LayerStyleSlider.vue.d.ts +38 -38
  53. package/dist/packages/components/source/SatSource.vue.d.ts +2053 -2002
  54. package/dist/packages/components/source/SatSourceMain.vue.d.ts +1852 -1823
  55. package/dist/packages/components/source/TerrainExaggerationSlider.vue.d.ts +16 -16
  56. package/dist/packages/components/source/helpers.d.ts +2 -1
  57. package/dist/packages/components/source/index.d.ts +2054 -2004
  58. package/dist/packages/components/task-view/SatTaskView.vue.d.ts +37 -37
  59. package/dist/packages/components/task-view/index.d.ts +37 -37
  60. package/dist/packages/components/types.d.ts +30 -30
  61. package/dist/packages/components/video-fusion/SatVideoFusion.vue.d.ts +170 -170
  62. package/dist/packages/components/video-fusion/index.d.ts +172 -172
  63. package/dist/packages/config/index.d.ts +8 -8
  64. package/dist/packages/config/injectKeys.d.ts +7 -7
  65. package/dist/packages/hooks/business/convertSatLayer.d.ts +5 -0
  66. package/dist/packages/hooks/effects/effectDeviceIsMobile.d.ts +1 -1
  67. package/dist/packages/hooks/ui/useDark.d.ts +1 -1
  68. package/dist/packages/hooks/useRenderer.d.ts +10 -10
  69. package/dist/packages/main/index.d.ts +14 -14
  70. package/dist/packages/store/modules/compState.d.ts +68 -68
  71. package/dist/packages/store/modules/layer.d.ts +18 -29
  72. package/dist/packages/store/modules/layout.d.ts +25 -25
  73. package/dist/packages/store/modules/partState.d.ts +28 -22
  74. package/dist/packages/store/modules/plot.d.ts +22 -22
  75. package/dist/packages/store/modules/taskView.d.ts +18 -18
  76. package/dist/packages/store/storeUtil.d.ts +2 -2
  77. package/dist/packages/types/element-plus-global.d.ts +108 -108
  78. package/dist/packages/types/module.d.ts +7 -7
  79. package/dist/packages/utils/map/analysis-spatial/index.d.ts +6 -6
  80. package/dist/packages/utils/map/analysis-spatial/section.d.ts +18 -18
  81. package/dist/packages/utils/map/index.d.ts +30 -30
  82. package/dist/packages/utils/map/layer/index.d.ts +19 -19
  83. package/dist/packages/utils/map/measure/index.d.ts +24 -24
  84. package/dist/packages/utils/map/plot/getGraphicDefStyle.d.ts +1 -1
  85. package/dist/packages/utils/map/plot/index.d.ts +44 -44
  86. package/dist/packages/utils/map/plot/plotSource.d.ts +754 -754
  87. package/dist/packages/utils/types/index.d.ts +1 -0
  88. package/dist/sat-earth.mjs +10626 -10618
  89. package/dist/sat-earth.umd.js +11 -11
  90. package/dist/style.css +1 -1
  91. package/package.json +2 -2
package/README.md CHANGED
@@ -1,2 +1,241 @@
1
- ## 什么是快乐“星球” ?
2
-   [SatEarth](https://gitee.com/gengkaibo/sat-earth)是一个三维地球组件库,目的是支持开发人员快速搭建三维场景。
1
+ ## 什么是快乐“星球” ?
2
+   [SatEarth](https://gitee.com/gengkaibo/sat-earth)是一个基于Vue3.x,面向开发者的三维地球组件库。
3
+
4
+ ## 组件库亮点
5
+ - 内置丰富基础功能组件以及菜单组件
6
+ - 对外暴露API,可随意调用sat-earth、mars3d、cesium API 进行定制化开发
7
+ - 功能组件可配合菜单组件也可独立运行,兼顾灵活与便捷
8
+ - ...
9
+
10
+ ## 前序准备
11
+ - [node](http://nodejs.org/) 和 [git](https://git-scm.com/) - 项目开发环境
12
+ - [Vite](https://vitejs.dev/) - 熟悉 vite 特性
13
+ - [Vue3](https://v3.vuejs.org/) - 熟悉 Vue 基础语法
14
+ - [TypeScript](https://www.typescriptlang.org/) - 熟悉 `TypeScript` 基本语法
15
+ - [Es6+](http://es6.ruanyifeng.com/) - 熟悉`es6`基本语法
16
+ - [Cesium](https://cesium.com/) - Cesium是一个开源的,基于webgl的二、三维地图引擎
17
+ - [Mars3D](http://mars3d.cn/) - 基于Cesium优化提升与B/S架构设计,支持多行业扩展的轻量级高效能GIS开发平台
18
+
19
+ ## 安装
20
+ - 首先在命令行执行如下命令添加 `sat-earth` 的依赖
21
+ ```bash
22
+ npm i sat-earth
23
+ ```
24
+
25
+ - 将 `node_modules/mars3d-cesium/Build/Cesium` 目录拷贝到我们开发目录中的public下
26
+ 然后在index.html中引入 `cesium` 库
27
+ ```html
28
+ <!--引入cesium基础lib-->
29
+ <link href="/Cesium/Widgets/widgets.css" rel="stylesheet" type="text/css" />
30
+ <script src="/Cesium/Cesium.js" type="text/javascript"></script>
31
+ ```
32
+
33
+ - 如果您的项目也用了`pinia`,请修改您项目中的piniaStore直接使用`sat-earth`的导出,并且main.ts中不需要在调用App.use(piniaStore)
34
+ ```ts
35
+ // const piniaStore = createPinia()
36
+ // export { piniaStore }
37
+ import { SatStore } from 'sat-earth'
38
+ const piniaStore = SatStore.piniaStore
39
+ export {
40
+ piniaStore
41
+ }
42
+ ```
43
+
44
+ - 在 `main.[jt]s` 中引入我们的 `sat-earth` 资源
45
+
46
+ ```ts
47
+ import { createApp } from "vue"
48
+ import App from "./app.vue"
49
+ import SatEarth from 'sat-earth'
50
+ import 'sat-earth/dist/style.css'
51
+ const app = createApp(App)
52
+ // SatEarth内部引入了ElementPlus,如果你也使用了element-plus,请在你的代码中注释掉不再引入,并且取消element-plus的按需自动导入(目前发现一些样式上的bug,我弃用了)
53
+ // import ElementPlus from 'element-plus'
54
+ // import 'element-plus/dist/index.css'
55
+ // import 'element-plus/theme-chalk/dark/css-vars.css'
56
+ // app.use(ElementPlus)
57
+ app.use(SatEarth)
58
+ app.mount("#app")
59
+
60
+ ```
61
+
62
+ - 在`tsconfig.json`中的`types`加入类型声明文件`sat-earth/dist/packages/auto-components`,来支持[Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)的类型提示
63
+ ```json
64
+ {
65
+ "compilerOptions": {
66
+ "target": "esnext", // 指定ts编译后的ECMAScript目标版本: 'es3' (default), 'es5', 'es2015', 'es2016', 'es2017', or 'esnext'
67
+ "module": "esnext", // 指定编译后代码使用的模块化规范: 'commonjs', 'amd', 'umd' or 'es...'
68
+ "declaration": false, // 是否生成声明文件
69
+ "strict": true, // 开启全部严格模式
70
+ "removeComments": true, // 删除注释
71
+ "allowJs": true, // 是否对js文件开启编译
72
+ "noImplicitAny": false, // 支持类型不标注可以默认any
73
+ "allowSyntheticDefaultImports": true, // 允许没有导出的模块中导入
74
+ "resolveJsonModule": true, // json文件是否可导入
75
+ "isolatedModules": true, // 将每个文件作为单独的模块
76
+ "useDefineForClassFields": true, // class类的变量声明方式从 = 赋值的方式变更成了Object.defineProperty;所有的字段声明都会生效,即使它没有指定默认值
77
+ "moduleResolution": "node", // 置顶模块的解析策略,'node' or 'classic'
78
+ "esModuleInterop": true, // 支持es6,commonjs模块
79
+ "skipLibCheck": true, // 跳过类库检测
80
+ "jsx": "preserve",
81
+ "lib": [
82
+ "esnext",
83
+ "dom"
84
+ ],
85
+ "types": [
86
+ "vite/client",
87
+ "sat-earth/dist/packages/auto-components"
88
+ ],
89
+ "paths": {
90
+ "@src/*": [
91
+ "./src/*"
92
+ ]
93
+ }
94
+ },
95
+ "include": [
96
+ "**/*.ts",
97
+ "**/*.d.ts",
98
+ "**/*.vue"
99
+ ]
100
+ }
101
+ ```
102
+
103
+ ## 开发文档
104
+ 等发布1.0版本补文档,暂时没有
105
+
106
+ ## 快速开始
107
+ ```ts
108
+ <script setup lang="ts">
109
+ import { type SatMapOptions } from 'sat-earth'
110
+ /*
111
+ 初始化参数尽量保证了和mars3d的Map构造一致性,但是任然有一些地方进行了小改动,具体查看类型SatMapOptions,下面请看改动:
112
+ 1. 在mars3d的Map构造参数的基础上扩展了custom对象。
113
+
114
+ custom: {
115
+ // 工具栏新增项
116
+ layoutTheme: {
117
+ primaryColor: '#409eff',
118
+ isDark: true,
119
+ },
120
+ toolbar: {
121
+ mapSplit: true // 开启卷帘工具
122
+ bookmark: true // 开启视角书签工具
123
+ keyboardRoam: true // 开启键盘漫游功能
124
+ },
125
+ plotModelUrlPrefix?: string // 标绘模型地址前缀
126
+ layers: {
127
+ // list 这是要加入到 'SatSource' 数据源管理中的自定义Layer图层,参数与 mars3d构造 Layer 的参数
128
+ // 一致,通过 'id/pid' 在 'SatSource' 组件中形成对应的树形结构, 如果不加pid的时候或者任意添加的
129
+ // pid导致在所有图层中并没有查找到该 pid 对应图层项时,组件会给该项添加默认pid并加到树的跟节点上。
130
+ list: []
131
+ // 辅助图层
132
+ auxiliaryLayers: {
133
+ cover: boolean // 是否覆盖内置的辅助图层
134
+ list: [] // 自定义的辅助图层Layer集合
135
+ },
136
+ // 地形图层
137
+ terrainLayers: {
138
+ cover: boolean // 是否覆盖内置的地形图层
139
+ list: [] // 自定义的地形图层Layer集合
140
+ }
141
+ }
142
+ }
143
+
144
+ 2. 对mars3d的Map构造参数中原有的basemaps的传参略作了修改。
145
+
146
+ basemaps:[] => basemaps:{
147
+ cover: boolean
148
+ list: []
149
+ }
150
+ ①. 在 'sat-earth' 中加入了默认的基础底图,这里可以选择是否覆盖重写;
151
+ ②. basemaps中配置的底图最终也会出现在 'SatSource' 数据源组件中的树形结构中;
152
+
153
+ */
154
+ const options: SatMapOptions = {
155
+ map3d: {
156
+ control: {
157
+ baseLayerPicker: true,
158
+ animation: false,
159
+ timeline: false
160
+ },
161
+ basemaps: {
162
+ cover: false,
163
+ list: []
164
+ },
165
+ custom: {
166
+ layoutTheme: {
167
+ primaryColor: '#409eff',
168
+ isDark: true,
169
+ },
170
+ toolbar: {
171
+ mapSplit: true, // 开启卷帘工具
172
+ bookmark: true, // 开启视角书签工具
173
+ keyboardRoam: true, // 开启键盘漫游功能
174
+ },
175
+ layers: {
176
+ /* list 这是要加入到数据源管理中的自定义Layer图层,参数与 mars3d构造 Layer 的参数一致,
177
+ 通过 'id/pid' 在 'SatSource' 组件中形成对应的树形结构, 不加 pid 的时候或者任意添加的 pid
178
+ 导致所有图层中并没有该 pid 对应图层项时,组件会给该项添加默认的 pid,并加入到树的跟节点上。
179
+ */
180
+ list: [
181
+ {
182
+ 'id': 202012,
183
+ 'type': '3dtiles',
184
+ 'name': '石化工厂',
185
+ 'url': 'http://data.mars3d.cn/3dtiles/max-shihua/tileset.json',
186
+ 'position': { 'lng': 117.077158, 'lat': 31.659116, 'alt': 24.6 },
187
+ 'maximumScreenSpaceError': 1,
188
+ 'maximumMemoryUsage': 1024,
189
+ 'highlight': { 'type': 'click', 'color': '#00FF00' },
190
+ 'popup': 'all',
191
+ 'flyTo': true,
192
+ 'scenetree': 'scenetree.json',
193
+ 'center': { 'lat': 31.654916, 'lng': 117.08278, 'alt': 279, 'heading': 316, 'pitch': -29 }
194
+ },
195
+ ],
196
+ // 辅助图层
197
+ auxiliaryLayers: {
198
+ cover: false, // 是否覆盖内置的辅助图层
199
+ list: [] // 自定义的辅助图层Layer集合
200
+ },
201
+ // 地形图层
202
+ terrainLayers: {
203
+ cover: false, // 是否覆盖内置的地形图层
204
+ list: [] // 自定义的地形图层Layer集合
205
+ },
206
+ },
207
+ },
208
+ },
209
+ }
210
+
211
+ </script>
212
+ ```
213
+ ```html
214
+ <template>
215
+ <!-- 注意:在SatGlobe外部无法使用组件 -->
216
+ <SatGlobe :sat-map-options="options">
217
+ <SatTaskView></SatTaskView>
218
+ <SatMenu>
219
+ <SatSource></SatSource>
220
+ <SatMapPart></SatMapPart>
221
+ <SatLocation></SatLocation>
222
+ <SatMeasure></SatMeasure>
223
+ <SatPlot></SatPlot>
224
+ <SatPicture ref="satPicture"></SatPicture>
225
+ </SatMenu>
226
+ </SatGlobe>
227
+ </template>
228
+ <style>
229
+ body {
230
+ margin: 0;
231
+ padding: 0;
232
+ }
233
+
234
+ #app {
235
+ width: 100vw;
236
+ height: 100vh;
237
+ position: relative;
238
+ }
239
+ </style>
240
+
241
+ ```
@@ -1,12 +1,12 @@
1
- import TheImageEditor from './index.vue';
2
- import tuiImageEditor from 'tui-image-editor';
3
- import type { UploadFile } from 'element-plus';
4
- import { ShallowRef } from 'vue';
5
- export { TheImageEditor };
6
- export interface TheImageEditorExpose {
7
- getInstance: () => ShallowRef<tuiImageEditor | undefined>;
8
- loadScene: (isIncludeDiv?: boolean) => void;
9
- uploadFile: (uploadFile: UploadFile) => void;
10
- uploadImageBase64: (base64: string) => void;
11
- download: (autoDownload?: boolean) => Promise<string> | undefined;
12
- }
1
+ import TheImageEditor from './index.vue';
2
+ import tuiImageEditor from 'tui-image-editor';
3
+ import type { UploadFile } from 'element-plus';
4
+ import { ShallowRef } from 'vue';
5
+ export { TheImageEditor };
6
+ export interface TheImageEditorExpose {
7
+ getInstance: () => ShallowRef<tuiImageEditor | undefined>;
8
+ loadScene: (isIncludeDiv?: boolean) => void;
9
+ uploadFile: (uploadFile: UploadFile) => void;
10
+ uploadImageBase64: (base64: string) => void;
11
+ download: (autoDownload?: boolean) => Promise<string> | undefined;
12
+ }
@@ -1,49 +1,49 @@
1
- /// <reference types="node" />
2
- import tuiImageEditor from 'tui-image-editor';
3
- import type { UploadFile } from 'element-plus';
4
- import { SatMap } from '../../../utils';
5
- declare const _sfc_main: import("vue").DefineComponent<{}, {
6
- mapInstance: import("vue").ShallowRef<SatMap | null> | undefined;
7
- mapCanvasEleId: string;
8
- instance: import("vue").ShallowRef<tuiImageEditor | undefined>;
9
- fileList: import("vue").Ref<{
10
- name: string;
11
- percentage?: number | undefined;
12
- status: import("element-plus").UploadStatus;
13
- size?: number | undefined;
14
- response?: unknown;
15
- uid: number;
16
- url?: string | undefined;
17
- raw?: {
18
- uid: number;
19
- readonly lastModified: number;
20
- readonly name: string;
21
- readonly webkitRelativePath: string;
22
- readonly size: number;
23
- readonly type: string;
24
- arrayBuffer: {
25
- (): Promise<ArrayBuffer>;
26
- (): Promise<ArrayBuffer>;
27
- };
28
- slice: {
29
- (start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
30
- (start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
31
- };
32
- stream: {
33
- (): ReadableStream<any>;
34
- (): NodeJS.ReadableStream;
35
- };
36
- text: {
37
- (): Promise<string>;
38
- (): Promise<string>;
39
- };
40
- } | undefined;
41
- }[]>;
42
- init: (imgUrl: string) => void;
43
- loadScene: (isIncludeDiv?: boolean | undefined) => void;
44
- uploadFile: (uploadFile: UploadFile) => void;
45
- uploadImageBase64: (base64: string) => void;
46
- download: (autoDownload?: boolean | undefined) => Promise<string> | undefined;
47
- getInstance: () => import("vue").ShallowRef<tuiImageEditor | undefined>;
48
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
49
- export default _sfc_main;
1
+ /// <reference types="node" />
2
+ import tuiImageEditor from 'tui-image-editor';
3
+ import type { UploadFile } from 'element-plus';
4
+ import { SatMap } from '../../../utils';
5
+ declare const _sfc_main: import("vue").DefineComponent<{}, {
6
+ mapInstance: import("vue").ShallowRef<SatMap | null> | undefined;
7
+ mapCanvasEleId: string;
8
+ instance: import("vue").ShallowRef<tuiImageEditor | undefined>;
9
+ fileList: import("vue").Ref<{
10
+ name: string;
11
+ percentage?: number | undefined;
12
+ status: import("element-plus").UploadStatus;
13
+ size?: number | undefined;
14
+ response?: unknown;
15
+ uid: number;
16
+ url?: string | undefined;
17
+ raw?: {
18
+ uid: number;
19
+ readonly lastModified: number;
20
+ readonly name: string;
21
+ readonly webkitRelativePath: string;
22
+ readonly size: number;
23
+ readonly type: string;
24
+ arrayBuffer: {
25
+ (): Promise<ArrayBuffer>;
26
+ (): Promise<ArrayBuffer>;
27
+ };
28
+ slice: {
29
+ (start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
30
+ (start?: number | undefined, end?: number | undefined, contentType?: string | undefined): Blob;
31
+ };
32
+ stream: {
33
+ (): ReadableStream<any>;
34
+ (): NodeJS.ReadableStream;
35
+ };
36
+ text: {
37
+ (): Promise<string>;
38
+ (): Promise<string>;
39
+ };
40
+ } | undefined;
41
+ }[]>;
42
+ init: (imgUrl: string) => void;
43
+ loadScene: (isIncludeDiv?: boolean | undefined) => void;
44
+ uploadFile: (uploadFile: UploadFile) => void;
45
+ uploadImageBase64: (base64: string) => void;
46
+ download: (autoDownload?: boolean | undefined) => Promise<string> | undefined;
47
+ getInstance: () => import("vue").ShallowRef<tuiImageEditor | undefined>;
48
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
49
+ export default _sfc_main;