cesium_dev_kit 1.1.19 → 1.1.20
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 +91 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,29 +14,25 @@
|
|
|
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
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.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
17
|
## API documentation
|
|
20
18
|
|
|
21
19
|
See [:bookmark_tabs: https://benpaodehenji.com/cesiumDevKitDoc](https://benpaodehenji.com/cesiumDevKitDoc)
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
21
|
## Features
|
|
26
22
|
|
|
27
|
-
|  |  |
|
|
28
|
-
| :-------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------: |
|
|
29
|
-
| material | analysis |
|
|
30
|
-
|  |  |
|
|
31
|
-
| dynamicRiver | extrude |
|
|
32
|
-
|  |  |
|
|
33
|
-
| radar | roaming |
|
|
34
|
-
|  |  |
|
|
35
|
-
| rayCast | fireworksEffect |
|
|
36
|
-
| 
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
23
|
+
|  |  |  |
|
|
24
|
+
| :-------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------: |
|
|
25
|
+
| material | analysis | plot |
|
|
26
|
+
|  |  |  |
|
|
27
|
+
| dynamicRiver | extrude | effect |
|
|
28
|
+
|  |  |  |
|
|
29
|
+
| radar | roaming | drag |
|
|
30
|
+
|  |  |  |
|
|
31
|
+
| rayCast | fireworksEffect | aniSoldier |
|
|
32
|
+
|  |  |  |
|
|
33
|
+
| pathPlan | customPrimitive | clusterLayer |
|
|
34
|
+
|  |  |  |
|
|
35
|
+
| bar3D | rollerBlind | heatmap3d |
|
|
40
36
|
|
|
41
37
|
[More>>](https://benpaodehenji.com/cesiumDevKit)
|
|
42
38
|
|
|
@@ -46,13 +42,90 @@ See [:bookmark_tabs: https://benpaodehenji.com/cesiumDevKitDoc](https://benpaode
|
|
|
46
42
|
npm install cesium_dev_kit
|
|
47
43
|
```
|
|
48
44
|
|
|
49
|
-
|
|
50
45
|
## Use
|
|
51
46
|
|
|
52
47
|
### 1、Import all
|
|
53
48
|
|
|
54
49
|
The initialization of 'initCesium' allows for the acquisition of all extension modules.
|
|
55
50
|
|
|
51
|
+
#### 1. General method
|
|
52
|
+
|
|
53
|
+
```javaScript
|
|
54
|
+
import * as Cesium from 'cesium';
|
|
55
|
+
import * as THREE from 'three';
|
|
56
|
+
import { initCesium } from 'cesium_dev_kit'
|
|
57
|
+
import { defaultStatic } from '/src/views/example/defaultStaticConf/index.js'
|
|
58
|
+
|
|
59
|
+
export default {
|
|
60
|
+
methods: {
|
|
61
|
+
// add terrain
|
|
62
|
+
async addWorldTerrainAsync (viewer) {
|
|
63
|
+
try {
|
|
64
|
+
const terrainProvider = await Cesium.CesiumTerrainProvider.fromIonAssetId(1);
|
|
65
|
+
viewer.terrainProvider = terrainProvider;
|
|
66
|
+
} catch (error) {
|
|
67
|
+
console.log(`Failed to add world imagery: ${error}`);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
initMap () {
|
|
71
|
+
// Configure multiple imagelayer arrays
|
|
72
|
+
const tempData = [
|
|
73
|
+
{
|
|
74
|
+
type: 'UrlTemplateImageryProvider',
|
|
75
|
+
option: {
|
|
76
|
+
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
type: 'UrlTemplateImageryProvider',
|
|
81
|
+
option: {
|
|
82
|
+
url: 'https://webst03.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&style=7',
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
// init .
|
|
87
|
+
const { viewer, material, graphics,sceneMang } =
|
|
88
|
+
new initCesium({
|
|
89
|
+
cesiumGlobal: Cesium,
|
|
90
|
+
threeGlobal: THREE,
|
|
91
|
+
containerId: 'cesiumContainer',
|
|
92
|
+
threeContainerId: 'threeContainer',
|
|
93
|
+
viewerConfig: {
|
|
94
|
+
infoBox: false,
|
|
95
|
+
shouldAnimate: true,
|
|
96
|
+
useDefaultRenderLoop: false,
|
|
97
|
+
selectionIndicator: false,
|
|
98
|
+
sceneModePicker: false
|
|
99
|
+
},
|
|
100
|
+
extraConfig: {
|
|
101
|
+
depthTest: true,
|
|
102
|
+
AccessToken:"your access token"
|
|
103
|
+
},
|
|
104
|
+
imageryProvider: {
|
|
105
|
+
type: "WebMapTileServiceImageryProvider",
|
|
106
|
+
option: {
|
|
107
|
+
url: "http://t0.tianditu.gov.cn/img_w/wmts?tk=65a5f62a964c1d5b23fa81bc34147973",
|
|
108
|
+
layer: "img",
|
|
109
|
+
style: "default",
|
|
110
|
+
tileMatrixSetID: "w",
|
|
111
|
+
format: "tiles",
|
|
112
|
+
maximumLevel: 18,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
MapImageryList: tempData,
|
|
116
|
+
defaultStatic
|
|
117
|
+
})
|
|
118
|
+
// Call method to add terrain
|
|
119
|
+
this.addWorldTerrainAsync(viewer);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
[For details, see :bookmark_tabs: https://benpaodehenji.com/cesiumDevKitDoc/module-initCesium.html ](https://benpaodehenji.com/cesiumDevKitDoc/module-initCesium.html)
|
|
126
|
+
|
|
127
|
+
#### 2. Custom viewer
|
|
128
|
+
|
|
56
129
|
```javaScript
|
|
57
130
|
import { initCesium } from 'cesium_dev_kit'
|
|
58
131
|
// custom viewer
|
|
@@ -129,8 +202,6 @@ const {viewer,graphics} = new Graphics({
|
|
|
129
202
|
new cesium_dev_kit.initCesium({...})
|
|
130
203
|
```
|
|
131
204
|
|
|
132
|
-
|
|
133
|
-
|
|
134
205
|
---
|
|
135
206
|
|
|
136
207
|
## Use example
|
package/package.json
CHANGED