cesium_dev_kit 1.0.73 → 1.0.75
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 +151 -94
- package/README.zh-CN.md +331 -0
- package/dist/index.js +2 -2
- package/dist/index.min.js +2 -2
- package/dist/index.umd.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,83 +4,88 @@
|
|
|
4
4
|
[![NPM Package][npm]][npm-url]
|
|
5
5
|
[![NPM DownloadsWeekly][npm-download]][npmtrends-url]
|
|
6
6
|
[![Build Size][build-size]][build-size-url]
|
|
7
|
-
[![GitHub Repo stars][repo-stars]][
|
|
7
|
+
[![GitHub Repo stars][repo-stars]][star-chart]
|
|
8
8
|
[![license][license-uri]][license-link]
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
**English** | [中文](./README.zh-CN.md)
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## Introduction
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
 This is a Cesium development kit that includes functionalities such as layer loading, coordinate conversion, coordinate picking, camera control, measurement, plotting, model loading and manipulation (translation, rotation scaling), 3Dtiles view position adjustment, weather effects (rain, snow, fog), scene rendering with radar scan and information box display capabilities. It also provides features for flow line visualization, lighting effects including dynamic wall and other luminous materials rendering.
|
|
15
|
+
Additionally it supports Post effects, visibility analysis tools for perspective analysis and slope analysis. Furthermore it offers Inundation analysis as well as volume analysis capabilities and terrain excavation functionality.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- materials
|
|
17
20
|

|
|
18
|
-
-
|
|
21
|
+
- analysis
|
|
19
22
|

|
|
20
|
-
-
|
|
23
|
+
- plotting
|
|
21
24
|

|
|
22
|
-
-
|
|
25
|
+
- dragging
|
|
23
26
|

|
|
24
|
-
-
|
|
27
|
+
- radar scan
|
|
25
28
|

|
|
26
|
-
-
|
|
27
|
-

|
|
28
31
|
|
|
29
|
-
##
|
|
32
|
+
## Preview
|
|
30
33
|
|
|
31
|
-
[https://
|
|
34
|
+
[https://benpaodehenji.com/cesiumDevKit](https://benpaodehenji.com/cesiumDevKit)
|
|
32
35
|
|
|
33
|
-
##
|
|
36
|
+
## Install
|
|
34
37
|
|
|
35
38
|
```shell
|
|
36
39
|
npm install cesium_dev_kit
|
|
37
40
|
```
|
|
38
41
|
|
|
39
|
-
##
|
|
42
|
+
## Import
|
|
40
43
|
|
|
41
44
|
```
|
|
42
45
|
import { initCesium } from 'cesium_dev_kit'
|
|
43
46
|
```
|
|
44
47
|
|
|
45
|
-
##
|
|
46
|
-
|
|
47
|
-
### 1
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### 1.1 initCesium
|
|
52
|
-
|
|
53
|
-
| Property
|
|
54
|
-
|
|
|
55
|
-
| cesiumGlobal
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
83
|
-
|
|
48
|
+
## Use
|
|
49
|
+
|
|
50
|
+
### 1、Import all
|
|
51
|
+
|
|
52
|
+
The initialization of 'initCesium' allows for the acquisition of all extension modules.
|
|
53
|
+
|
|
54
|
+
### 1.1 The initCesium method configuration parameter list
|
|
55
|
+
|
|
56
|
+
| Property | Type | Description | Default |
|
|
57
|
+
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | --------- |
|
|
58
|
+
| cesiumGlobal | Object | Cesium Object | undefined |
|
|
59
|
+
| threeGlobal | Object | THREE Object | undefined |
|
|
60
|
+
| containerId | String | Cesium mounts dom container id | undefined |
|
|
61
|
+
| threeContainerId | String | Three mounts dom container id | undefined |
|
|
62
|
+
| viewerConfig | Object | viewer base configuration (same as official website) | {} |
|
|
63
|
+
| extreaConfig | Object | Configure additional parameters, such as {logo: true// Whether to display logo, depthTest: true// Enable depth detection} | {} |
|
|
64
|
+
| MapImageryList | Array | To configure the base image, see ImageryProvider | [] |
|
|
65
|
+
| defaultStatic | Array | Static resource configurations used by shaders (such as image urls) | undefined |
|
|
66
|
+
|
|
67
|
+
### 1.2 The initCesium method returns the result
|
|
68
|
+
|
|
69
|
+
| name | Type | Description |
|
|
70
|
+
| ------------------ | ------ | ------------------------------------------------------------------------------ |
|
|
71
|
+
| viewer | Object | Cesium instance object |
|
|
72
|
+
| material | Object | Material module (Modify physical material) |
|
|
73
|
+
| graphics | Object | Graphics modules (e.g. creating PolygonGraphics objects, etc.) |
|
|
74
|
+
| math3d | Object | Three-dimensional mathematical tool |
|
|
75
|
+
| primitive | Object | Primitives manipulate objects (such as creating polygon using primivite, etc.) |
|
|
76
|
+
| draw | Object | Drawing modules (e.g. polygons, rectangles) |
|
|
77
|
+
| passEffect | Object | Post-processing module |
|
|
78
|
+
| customCesiumPlugin | Object | Custom sensor extensions |
|
|
79
|
+
| control | Object | Control modules (such as model positioning, dragging, etc.) |
|
|
80
|
+
| plugin | Object | Additional plugins (such as expanding css3 animation, terrain cropping) |
|
|
81
|
+
| base | Object | Basic modules (e.g. coordinate conversion, layer initialization, etc.) |
|
|
82
|
+
| analysis | Object | Analysis modules (e.g., slope, direction, visibility, visibility analysis) |
|
|
83
|
+
| attackArrowObj | Object | Plotting (attack) |
|
|
84
|
+
| straightArrowObj | Object | Plotting (straight hit) |
|
|
85
|
+
| pincerArrowObj | Object | Plotting(Pincer attack) |
|
|
86
|
+
| ThreeJs | Object | Integrate ThreeJS extension objects |
|
|
87
|
+
|
|
88
|
+
### 1.3 Use case
|
|
84
89
|
|
|
85
90
|
```javaScript
|
|
86
91
|
// test.vue
|
|
@@ -99,7 +104,7 @@ export default {
|
|
|
99
104
|
const tempData = [
|
|
100
105
|
{
|
|
101
106
|
id: 3,
|
|
102
|
-
name: '
|
|
107
|
+
name: 'gaodeMap02',
|
|
103
108
|
type: 'UrlTemplateImageryProvider',
|
|
104
109
|
classConfig: {
|
|
105
110
|
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
|
@@ -132,29 +137,30 @@ export default {
|
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
139
|
</script>
|
|
140
|
+
|
|
135
141
|
```
|
|
136
142
|
|
|
137
|
-
### 2
|
|
143
|
+
### 2、Import on demand
|
|
138
144
|
|
|
139
|
-
|
|
145
|
+
The import of a single extension class can be tailored to meet specific functional requirements, thereby minimizing code redundancy.
|
|
140
146
|
|
|
141
147
|
```javaScript
|
|
142
|
-
|
|
148
|
+
import {Graphics, Material,Primitive,Draw,Analysis,CustomCesiumPlugin,PassEffect,Plugin,ThreeJs} from 'cesium_dev_kit'
|
|
143
149
|
```
|
|
144
150
|
|
|
145
|
-
### 2.1
|
|
151
|
+
### 2.1 Extension class:
|
|
146
152
|
|
|
147
|
-
- Graphics
|
|
148
|
-
- Material:
|
|
149
|
-
- Primitive:
|
|
150
|
-
- Draw:
|
|
151
|
-
- Analysis:
|
|
152
|
-
- CustomCesiumPlugin:
|
|
153
|
-
- PassEffect:
|
|
154
|
-
- Plugin:
|
|
155
|
-
- ThreeJs:
|
|
153
|
+
- Graphics:Various graphic operations
|
|
154
|
+
- Material: Material manipulation
|
|
155
|
+
- Primitive: Cooperate with various primitive operations of shader
|
|
156
|
+
- Draw: Various drawing objects
|
|
157
|
+
- Analysis: Various analysis objects
|
|
158
|
+
- CustomCesiumPlugin: Custom sensor expansion
|
|
159
|
+
- PassEffect: Post effect object
|
|
160
|
+
- Plugin: Various extension functions
|
|
161
|
+
- ThreeJs: Integrate ThreeJS extension objects
|
|
156
162
|
|
|
157
|
-
### 2.2 Draw
|
|
163
|
+
### 2.2 Draw Use case:
|
|
158
164
|
|
|
159
165
|
```javaScript
|
|
160
166
|
// test.vue
|
|
@@ -172,7 +178,7 @@ export default {
|
|
|
172
178
|
const tempData = [
|
|
173
179
|
{
|
|
174
180
|
id: 3,
|
|
175
|
-
name: '
|
|
181
|
+
name: 'gaodeMap02',
|
|
176
182
|
type: 'UrlTemplateImageryProvider',
|
|
177
183
|
classConfig: {
|
|
178
184
|
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
|
@@ -188,18 +194,18 @@ export default {
|
|
|
188
194
|
}]
|
|
189
195
|
|
|
190
196
|
const drawObj = new Draw({
|
|
191
|
-
cesiumGlobal: Cesium, //
|
|
192
|
-
containerId: 'cesiumContainer', //
|
|
193
|
-
viewerConfig: { //
|
|
197
|
+
cesiumGlobal: Cesium, //Global Cesium object
|
|
198
|
+
containerId: 'cesiumContainer', // Container id
|
|
199
|
+
viewerConfig: { // Same as the official viewer configuration
|
|
194
200
|
infoBox: false,
|
|
195
201
|
shouldAnimate: true,
|
|
196
202
|
},
|
|
197
|
-
extraConfig: {//
|
|
198
|
-
logo:true, //
|
|
199
|
-
depthTest:true //
|
|
203
|
+
extraConfig: {// Other configuration
|
|
204
|
+
logo:true, // Whether to display logo
|
|
205
|
+
depthTest:true // Whether to enable the depth test
|
|
200
206
|
},
|
|
201
|
-
MapImageryList: tempData //
|
|
202
|
-
defaultStatic //
|
|
207
|
+
MapImageryList: tempData // Base map configuration
|
|
208
|
+
defaultStatic // default server address and material and other basic information configuration, please refer to src\views\example\defaultStaticConf\index.js
|
|
203
209
|
})
|
|
204
210
|
|
|
205
211
|
this.c_viewer = drawObj.viewer
|
|
@@ -217,51 +223,97 @@ export default {
|
|
|
217
223
|
</script>
|
|
218
224
|
```
|
|
219
225
|
|
|
220
|
-
###
|
|
226
|
+
### Used in h5
|
|
221
227
|
|
|
222
|
-
-
|
|
228
|
+
- Import index.umd.js directly into html
|
|
223
229
|
|
|
224
230
|
```javaScript
|
|
225
231
|
<script type="text/javascript" src="index.umd.js"></script>
|
|
226
232
|
```
|
|
227
233
|
|
|
228
|
-
-
|
|
234
|
+
- Initialize object
|
|
229
235
|
|
|
230
236
|
```javaScript
|
|
231
237
|
new cesium_dev_kit.initCesium({...})
|
|
232
238
|
```
|
|
233
239
|
|
|
234
|
-
##
|
|
240
|
+
## Use example
|
|
235
241
|
|
|
236
|
-
- ES6
|
|
242
|
+
- ES6 Use case
|
|
237
243
|
[https://github.com/dengxiaoning/cesium_kit_test](https://github.com/dengxiaoning/cesium_kit_test)
|
|
238
244
|
|
|
239
|
-
- H5
|
|
245
|
+
- H5 Use case
|
|
240
246
|
[https://github.com/dengxiaoning/cesium_kit_test_h5](https://github.com/dengxiaoning/cesium_kit_test_h5)
|
|
241
247
|
|
|
242
248
|
##
|
|
243
249
|
|
|
244
|
-
##
|
|
250
|
+
## Browser support
|
|
245
251
|
|
|
246
|
-
|
|
252
|
+
The 'Chrome 80+' browser is recommended for local development
|
|
247
253
|
|
|
248
|
-
|
|
254
|
+
Modern browsers (chrome, Firefox, Microsoft edge, etc.) are supported. Internet Explorer is not supported
|
|
249
255
|
|
|
250
|
-
##
|
|
256
|
+
## Thanks
|
|
251
257
|
|
|
252
258
|
[cesium-d3kit](https://github.com/zhangti0708/cesium-d3kit)<br/>
|
|
253
259
|
[drawarrowforcesium](https://gitcode.net/mirrors/gitgitczl/drawarrowforcesium)<br/>
|
|
254
260
|
[vue3-ts-cesium-map-show](https://gitee.com/hawk86104/vue3-ts-cesium-map-show)<br/>
|
|
255
261
|
|
|
256
|
-
|
|
262
|
+
This project includes but is not limited to the reference and reference of the above materials, thank you very much for sharing
|
|
263
|
+
|
|
264
|
+
## Project deficiency and optimization
|
|
265
|
+
|
|
266
|
+
- 1、Extended classes not using type detection (TS)
|
|
267
|
+
- 2、No usage documentation (please refer to the case)
|
|
268
|
+
- 3、No exception catching and handling
|
|
269
|
+
|
|
270
|
+
## How to contribute
|
|
271
|
+
|
|
272
|
+
<a href="https://github.com/dengxiaoning/cesium_dev_kit/graphs/contributors">
|
|
273
|
+
<img src="https://contrib.rocks/image?repo=dengxiaoning/cesium_dev_kit" />
|
|
274
|
+
</a>
|
|
275
|
+
|
|
276
|
+
You can [Raise an issue](https://github.com/dengxiaoning/cesium_dev_kit/issues/new) Or submit a Pull Request.
|
|
277
|
+
|
|
278
|
+
**Pull Request:**
|
|
279
|
+
|
|
280
|
+
1. Fork code
|
|
281
|
+
2. Create your own branch: `git checkout -b feat/xxxx`
|
|
282
|
+
3. Submit your changes: `git commit -am 'feat(function): add xxxxx'`
|
|
283
|
+
4. Push your branch: `git push origin feat/xxxx`
|
|
284
|
+
5. submit `pull request`
|
|
285
|
+
|
|
286
|
+
## Git Contribution submission specification
|
|
287
|
+
|
|
288
|
+
- `feat` New features
|
|
289
|
+
- `fix` Fix bugs
|
|
290
|
+
- `docs` document
|
|
291
|
+
- `style` Format and style (changes that do not affect code operation)
|
|
292
|
+
- `refactor` Refactor
|
|
293
|
+
- `perf` Optimize related, such as improving performance and experience
|
|
294
|
+
- `test` Add test
|
|
295
|
+
- `build` Compilation related modifications, changes to project construction or dependencies
|
|
296
|
+
- `ci` Continuous integration modification
|
|
297
|
+
- `chore` Changes in the construction process or auxiliary tools
|
|
298
|
+
- `revert` Rollback to previous version
|
|
299
|
+
- `workflow` Workflow improvement
|
|
300
|
+
- `mod` Uncertain modification classification
|
|
301
|
+
- `wip` Under development
|
|
302
|
+
- `types` type
|
|
303
|
+
|
|
304
|
+
<small>Welcome interested friends to join together to improve the function, so that the work is more efficient, the development is simpler, and the life is more comfortable.</small>
|
|
305
|
+
|
|
306
|
+
## `Star`
|
|
307
|
+
|
|
308
|
+
I am grateful to the those good people who awarded me These stars, and I appreciate your ongoing support. :heart:
|
|
309
|
+
|
|
310
|
+
[![Stargazers repo roster for @dengxiaoning/cesium_dev_kit][stargazers-url]][stargazers-link]
|
|
257
311
|
|
|
258
|
-
##
|
|
312
|
+
## `Fork`
|
|
259
313
|
|
|
260
|
-
-
|
|
261
|
-
- 2、未配备使用文档(请参考案例)
|
|
262
|
-
- 3、未作异常捕捉和处理
|
|
314
|
+
@sincely、`@ooil929`、 @InPanda、 `luyufanzhi`、AllenChiangCN、`Liquid-Zhangliquan` Thank you for your attention. :heart:
|
|
263
315
|
|
|
264
|
-
|
|
316
|
+
[![Forkers repo roster for @dengxiaoning/cesium_dev_kit][forkers-url]][forkers-link]
|
|
265
317
|
|
|
266
318
|
[npm]: https://img.shields.io/npm/v/cesium_dev_kit
|
|
267
319
|
[npm-url]: https://www.npmjs.com/package/cesium_dev_kit
|
|
@@ -274,3 +326,8 @@ new cesium_dev_kit.initCesium({...})
|
|
|
274
326
|
[build-status]: https://github.com/dengxiaoning/cesium_dev_kit
|
|
275
327
|
[build-main]: https://img.shields.io/github/actions/workflow/status/dengxiaoning/cesium_dev_kit/project-build.yml?branch=main&logo=github
|
|
276
328
|
[repo-stars]: https://img.shields.io/github/stars/dengxiaoning/cesium_dev_kit?style=plastic&logo=github
|
|
329
|
+
[forkers-url]: https://bytecrank.com/nastyox/reporoster/php/forkersSVG.php?user=dengxiaoning&repo=cesium_dev_kit
|
|
330
|
+
[forkers-link]: https://github.com/dengxiaoning/cesium_dev_kit/network/members
|
|
331
|
+
[stargazers-url]: https://bytecrank.com/nastyox/reporoster/php/stargazersSVG.php?user=dengxiaoning&repo=cesium_dev_kit
|
|
332
|
+
[stargazers-link]: https://github.com/dengxiaoning/cesium_dev_kit/stargazers
|
|
333
|
+
[star-chart]: https://api.star-history.com/svg?repos=dengxiaoning/cesium_dev_kit&type=Date
|