cesium_dev_kit 1.0.74 → 1.0.76
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 +137 -98
- 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,85 +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 | Type | Description
|
|
54
|
-
| ---------------- | ------ |
|
|
55
|
-
| cesiumGlobal | Object | Cesium
|
|
56
|
-
| threeGlobal | Object | THREE
|
|
57
|
-
| containerId | String | Cesium
|
|
58
|
-
| threeContainerId | String | Three
|
|
59
|
-
| viewerConfig | Object | viewer
|
|
60
|
-
| extreaConfig | Object |
|
|
61
|
-
| MapImageryList | Array |
|
|
62
|
-
| defaultStatic | Array |
|
|
63
|
-
|
|
64
|
-
### 1.2 initCesium
|
|
65
|
-
|
|
66
|
-
| name | Type | Description
|
|
67
|
-
| ------------------ | ------ |
|
|
68
|
-
| viewer | Object | Cesium
|
|
69
|
-
| material | Object |
|
|
70
|
-
| graphics | Object |
|
|
71
|
-
| math3d | Object |
|
|
72
|
-
| primitive | Object |
|
|
73
|
-
| draw | Object |
|
|
74
|
-
| passEffect | Object |
|
|
75
|
-
| customCesiumPlugin | Object |
|
|
76
|
-
| control | Object |
|
|
77
|
-
| plugin | Object |
|
|
78
|
-
| base | Object |
|
|
79
|
-
| analysis | Object |
|
|
80
|
-
| attackArrowObj | Object |
|
|
81
|
-
| straightArrowObj | Object |
|
|
82
|
-
| pincerArrowObj | Object |
|
|
83
|
-
| ThreeJs | Object |
|
|
84
|
-
|
|
85
|
-
### 1.3
|
|
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
|
|
86
89
|
|
|
87
90
|
```javaScript
|
|
88
91
|
// test.vue
|
|
@@ -101,7 +104,7 @@ export default {
|
|
|
101
104
|
const tempData = [
|
|
102
105
|
{
|
|
103
106
|
id: 3,
|
|
104
|
-
name: '
|
|
107
|
+
name: 'gaodeMap02',
|
|
105
108
|
type: 'UrlTemplateImageryProvider',
|
|
106
109
|
classConfig: {
|
|
107
110
|
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
|
@@ -134,29 +137,30 @@ export default {
|
|
|
134
137
|
}
|
|
135
138
|
}
|
|
136
139
|
</script>
|
|
140
|
+
|
|
137
141
|
```
|
|
138
142
|
|
|
139
|
-
### 2
|
|
143
|
+
### 2、Import on demand
|
|
140
144
|
|
|
141
|
-
|
|
145
|
+
The import of a single extension class can be tailored to meet specific functional requirements, thereby minimizing code redundancy.
|
|
142
146
|
|
|
143
147
|
```javaScript
|
|
144
|
-
|
|
148
|
+
import {Graphics, Material,Primitive,Draw,Analysis,CustomCesiumPlugin,PassEffect,Plugin,ThreeJs} from 'cesium_dev_kit'
|
|
145
149
|
```
|
|
146
150
|
|
|
147
|
-
### 2.1
|
|
151
|
+
### 2.1 Extension class:
|
|
148
152
|
|
|
149
|
-
- Graphics
|
|
150
|
-
- Material:
|
|
151
|
-
- Primitive:
|
|
152
|
-
- Draw:
|
|
153
|
-
- Analysis:
|
|
154
|
-
- CustomCesiumPlugin:
|
|
155
|
-
- PassEffect:
|
|
156
|
-
- Plugin:
|
|
157
|
-
- 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
|
|
158
162
|
|
|
159
|
-
### 2.2 Draw
|
|
163
|
+
### 2.2 Draw Use case:
|
|
160
164
|
|
|
161
165
|
```javaScript
|
|
162
166
|
// test.vue
|
|
@@ -174,7 +178,7 @@ export default {
|
|
|
174
178
|
const tempData = [
|
|
175
179
|
{
|
|
176
180
|
id: 3,
|
|
177
|
-
name: '
|
|
181
|
+
name: 'gaodeMap02',
|
|
178
182
|
type: 'UrlTemplateImageryProvider',
|
|
179
183
|
classConfig: {
|
|
180
184
|
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
|
@@ -190,18 +194,18 @@ export default {
|
|
|
190
194
|
}]
|
|
191
195
|
|
|
192
196
|
const drawObj = new Draw({
|
|
193
|
-
cesiumGlobal: Cesium, //
|
|
194
|
-
containerId: 'cesiumContainer', //
|
|
195
|
-
viewerConfig: { //
|
|
197
|
+
cesiumGlobal: Cesium, //Global Cesium object
|
|
198
|
+
containerId: 'cesiumContainer', // Container id
|
|
199
|
+
viewerConfig: { // Same as the official viewer configuration
|
|
196
200
|
infoBox: false,
|
|
197
201
|
shouldAnimate: true,
|
|
198
202
|
},
|
|
199
|
-
extraConfig: {//
|
|
200
|
-
logo:true, //
|
|
201
|
-
depthTest:true //
|
|
203
|
+
extraConfig: {// Other configuration
|
|
204
|
+
logo:true, // Whether to display logo
|
|
205
|
+
depthTest:true // Whether to enable the depth test
|
|
202
206
|
},
|
|
203
|
-
MapImageryList: tempData //
|
|
204
|
-
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
|
|
205
209
|
})
|
|
206
210
|
|
|
207
211
|
this.c_viewer = drawObj.viewer
|
|
@@ -219,61 +223,95 @@ export default {
|
|
|
219
223
|
</script>
|
|
220
224
|
```
|
|
221
225
|
|
|
222
|
-
###
|
|
226
|
+
### Used in h5
|
|
223
227
|
|
|
224
|
-
-
|
|
228
|
+
- Import index.umd.js directly into html
|
|
225
229
|
|
|
226
230
|
```javaScript
|
|
227
231
|
<script type="text/javascript" src="index.umd.js"></script>
|
|
228
232
|
```
|
|
229
233
|
|
|
230
|
-
-
|
|
234
|
+
- Initialize object
|
|
231
235
|
|
|
232
236
|
```javaScript
|
|
233
237
|
new cesium_dev_kit.initCesium({...})
|
|
234
238
|
```
|
|
235
239
|
|
|
236
|
-
##
|
|
240
|
+
## Use example
|
|
237
241
|
|
|
238
|
-
- ES6
|
|
242
|
+
- ES6 Use case
|
|
239
243
|
[https://github.com/dengxiaoning/cesium_kit_test](https://github.com/dengxiaoning/cesium_kit_test)
|
|
240
244
|
|
|
241
|
-
- H5
|
|
245
|
+
- H5 Use case
|
|
242
246
|
[https://github.com/dengxiaoning/cesium_kit_test_h5](https://github.com/dengxiaoning/cesium_kit_test_h5)
|
|
243
247
|
|
|
244
248
|
##
|
|
245
249
|
|
|
246
|
-
##
|
|
250
|
+
## Browser support
|
|
247
251
|
|
|
248
|
-
|
|
252
|
+
The 'Chrome 80+' browser is recommended for local development
|
|
249
253
|
|
|
250
|
-
|
|
254
|
+
Modern browsers (chrome, Firefox, Microsoft edge, etc.) are supported. Internet Explorer is not supported
|
|
251
255
|
|
|
252
|
-
##
|
|
256
|
+
## Thanks
|
|
253
257
|
|
|
254
258
|
[cesium-d3kit](https://github.com/zhangti0708/cesium-d3kit)<br/>
|
|
255
259
|
[drawarrowforcesium](https://gitcode.net/mirrors/gitgitczl/drawarrowforcesium)<br/>
|
|
256
260
|
[vue3-ts-cesium-map-show](https://gitee.com/hawk86104/vue3-ts-cesium-map-show)<br/>
|
|
257
261
|
|
|
258
|
-
|
|
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`
|
|
259
285
|
|
|
260
|
-
##
|
|
286
|
+
## Git Contribution submission specification
|
|
261
287
|
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
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
|
|
265
303
|
|
|
266
|
-
<small
|
|
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>
|
|
267
305
|
|
|
268
306
|
## `Star`
|
|
269
307
|
|
|
270
|
-
|
|
308
|
+
I am grateful to the generous individuals who awarded me these little stars, thank you for your support :heart:
|
|
271
309
|
|
|
272
310
|
[![Stargazers repo roster for @dengxiaoning/cesium_dev_kit][stargazers-url]][stargazers-link]
|
|
273
311
|
|
|
274
312
|
## `Fork`
|
|
275
313
|
|
|
276
|
-
@sincely、`@ooil929`、 @InPanda、 `luyufanzhi`、AllenChiangCN、`Liquid-Zhangliquan
|
|
314
|
+
@sincely、`@ooil929`、 @InPanda、 `luyufanzhi`、AllenChiangCN、`Liquid-Zhangliquan`... thank you for your attention :heart:
|
|
277
315
|
|
|
278
316
|
[![Forkers repo roster for @dengxiaoning/cesium_dev_kit][forkers-url]][forkers-link]
|
|
279
317
|
|
|
@@ -292,3 +330,4 @@ new cesium_dev_kit.initCesium({...})
|
|
|
292
330
|
[forkers-link]: https://github.com/dengxiaoning/cesium_dev_kit/network/members
|
|
293
331
|
[stargazers-url]: https://bytecrank.com/nastyox/reporoster/php/stargazersSVG.php?user=dengxiaoning&repo=cesium_dev_kit
|
|
294
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
|