cesium_dev_kit 1.1.18 → 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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022-present dengxiaoning
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022-present dengxiaoning
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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
- | ![material](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/material.gif) | ![analysis](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/analysis.gif) | ![plot](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/plot.gif) |
28
- | :-------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------: |
29
- | material | analysis | plot |
30
- | ![dynamicRiver](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/dnyRiver.gif) | ![extrude](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/extrude.gif) | ![effect](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/effect.gif) |
31
- | dynamicRiver | extrude | effect |
32
- | ![radar](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/radar.gif) | ![roaming](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/pathRoam.gif) | ![drag](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/drag.gif) |
33
- | radar | roaming | drag |
34
- | ![rayCast](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/rayCast.gif) | ![fireworksEffect](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/fireworksEffect.gif) | ![aniSoldier](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/aniSoldier.gif) |
35
- | rayCast | fireworksEffect | aniSoldier |
36
- | ![pathPlan](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/pathPlan.gif) |![customPrimitive](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/custPrimitive.gif) |![clusterLayer](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/clusterLayer.gif) |
37
- | pathPlan | customPrimitive | clusterLayer |
38
- | ![bar3D](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/bar3d.gif) | ![rollerBlind](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/rollerBlind.gif) | ![heatmap3d](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/heatmap3d.gif) |
39
- | bar3D | rollerBlind | heatmap3d |
23
+ | ![material](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/material.gif) | ![analysis](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/analysis.gif) | ![plot](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/plot.gif) |
24
+ | :-------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------: |
25
+ | material | analysis | plot |
26
+ | ![dynamicRiver](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/dnyRiver.gif) | ![extrude](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/extrude.gif) | ![effect](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/effect.gif) |
27
+ | dynamicRiver | extrude | effect |
28
+ | ![radar](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/radar.gif) | ![roaming](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/pathRoam.gif) | ![drag](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/drag.gif) |
29
+ | radar | roaming | drag |
30
+ | ![rayCast](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/rayCast.gif) | ![fireworksEffect](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/fireworksEffect.gif) | ![aniSoldier](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/aniSoldier.gif) |
31
+ | rayCast | fireworksEffect | aniSoldier |
32
+ | ![pathPlan](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/pathPlan.gif) | ![customPrimitive](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/custPrimitive.gif) | ![clusterLayer](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/clusterLayer.gif) |
33
+ | pathPlan | customPrimitive | clusterLayer |
34
+ | ![bar3D](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/bar3d.gif) | ![rollerBlind](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/rollerBlind.gif) | ![heatmap3d](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/heatmap3d.gif) |
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