cesium_dev_kit 1.0.63 → 1.0.66

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 CHANGED
@@ -22,6 +22,8 @@
22
22
  ![drag](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/drag.gif)
23
23
  - 雷达扫描
24
24
  ![radar](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/radar.gif)
25
+ - 第一人称漫游
26
+ ![radar](https://github.com/dengxiaoning/cesium_dev_kit/blob/main/src/assets/image/preview/pathRoam.gif)
25
27
 
26
28
  ## 在线预览
27
29
 
@@ -45,6 +47,8 @@ import { initCesium } from 'cesium_dev_kit'
45
47
 
46
48
  ## 使用
47
49
 
50
+ ### 1、引入所有模块
51
+
48
52
  ```javaScript
49
53
  // test.vue
50
54
  <template>
@@ -92,6 +96,77 @@ export default {
92
96
  </script>
93
97
  ```
94
98
 
99
+ ### 2、按需引入
100
+
101
+ ```javaScript
102
+ // test.vue
103
+ <template>
104
+ <div id="cesiumContainer"
105
+ class="map3d-contaner"></div>
106
+ </template>
107
+ <script>
108
+
109
+ /**
110
+ * 可导出对象 {Graphics, Material,Primitive,Draw,Analysis,CustomCesiumPlugin,PassEffect,Plugin}
111
+ * Graphics: 各种图形操作、Material: 材质操作、Primitive: 配合shader的各种图元操作
112
+ * Draw: 各种绘制对象、Analysis: 各种分析对象、CustomCesiumPlugin: 自定义相控扩展
113
+ * PassEffect: 后期特效对象、Plugin: 各种扩展功能
114
+ */
115
+ import { Draw } from 'cesium_dev_kit'
116
+ export default {
117
+ mounted() {
118
+ this.initMap()
119
+ },
120
+ methods: {
121
+ initMap() {
122
+ const tempData = [
123
+ {
124
+ id: 3,
125
+ name: '高德地图02',
126
+ type: 'UrlTemplateImageryProvider',
127
+ classConfig: {
128
+ url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
129
+ },
130
+ interfaceConfig: {},
131
+ offset: '0,0',
132
+ invertswitch: 0,
133
+ filterRGB: '#ffffff',
134
+ showswitch: 1,
135
+ weigh: 13,
136
+ createtime: 1624346908,
137
+ updatetime: 1647395260,
138
+ }]
139
+
140
+ const drawObj = new Draw({
141
+ cesiumGlobal: Cesium, // 全局Cesium对象
142
+ containerId: 'cesiumContainer', // 容器id
143
+ viewerConfig: { // 同官方的viewer配置相同
144
+ infoBox: false,
145
+ shouldAnimate: true,
146
+ },
147
+ extraConfig: {// 其他配置
148
+ logo:true, // 是否显示logo
149
+ depthTest:true // 是否开启深度测试
150
+ },
151
+ MapImageryList: tempData // 底图配置
152
+ defaultStatic // 默认服务器地址以及材质等基础信息配置,具体请参考src\views\example\defaultStaticConf\index.js
153
+ })
154
+
155
+ this.c_viewer = drawObj.viewer
156
+ this.draw = drawObj.draw
157
+ this.draw.setDefSceneConfig()
158
+ this.draw.setBloomLightScene()
159
+ this.load3dTiles(drawObj.viewer)
160
+
161
+ this.StraightArrowObj = drawObj.straightArrowObj
162
+ this.AttackArrowObj = drawObj.attackArrowObj
163
+ this.PincerArrowObj = drawObj.pincerArrowObj
164
+ }
165
+ }
166
+ }
167
+ </script>
168
+ ```
169
+
95
170
  ### 如需在 H5 中使用
96
171
 
97
172
  - html 中直接引入 index.umd.js