cesium_dev_kit 1.0.75 → 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 +2 -2
- 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.zh-CN.md +0 -331
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cesium_dev_kit",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.76",
|
|
4
|
+
"description": "Encapsulate common Cesium APIs to provide reference cases and modular packaging, out of the box - quickly achieve a variety of effect.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
package/README.zh-CN.md
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
## cesium_dev_kit
|
|
2
|
-
|
|
3
|
-
[![Build Status][build-main]][build-status]
|
|
4
|
-
[![NPM Package][npm]][npm-url]
|
|
5
|
-
[![NPM DownloadsWeekly][npm-download]][npmtrends-url]
|
|
6
|
-
[![Build Size][build-size]][build-size-url]
|
|
7
|
-
[![GitHub Repo stars][repo-stars]][star-chart]
|
|
8
|
-
[![license][license-uri]][license-link]
|
|
9
|
-
|
|
10
|
-
[English](./README.md) | **中文**
|
|
11
|
-
|
|
12
|
-
## 简介
|
|
13
|
-
|
|
14
|
-
这是一个 Cesium 开发工具包,包含图层加载、坐标转换、坐标拾取、相机控制、测量、标绘、模型加载、模型平移旋转缩放、模型/3Dtiles 视角位置调整、模型拖拽、天气(雨,雪,雾)场景、雷达扫描、信息框、流动线、发光线、动态墙等各种发光材质、后置场景效果、通视分析、透视分析、坡度分析、淹没分析、方量分析、地形开挖等各种分析案例。
|
|
15
|
-
|
|
16
|
-
## 功能展示
|
|
17
|
-
|
|
18
|
-
- 材质
|
|
19
|
-

|
|
20
|
-
- 分析
|
|
21
|
-

|
|
22
|
-
- 标绘
|
|
23
|
-

|
|
24
|
-
- 拖拽
|
|
25
|
-

|
|
26
|
-
- 雷达扫描
|
|
27
|
-

|
|
28
|
-
- 第一人称漫游
|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
## 在线预览
|
|
32
|
-
|
|
33
|
-
[https://benpaodehenji.com/cesiumDevKit](https://benpaodehenji.com/cesiumDevKit)
|
|
34
|
-
|
|
35
|
-
## 安装
|
|
36
|
-
|
|
37
|
-
```shell
|
|
38
|
-
npm install cesium_dev_kit
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## 引入
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
import { initCesium } from 'cesium_dev_kit'
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## 使用
|
|
48
|
-
|
|
49
|
-
### 1、完整引入
|
|
50
|
-
|
|
51
|
-
通过初始化`initCesium` 可以获取到所有扩展模块
|
|
52
|
-
|
|
53
|
-
### 1.1 initCesium 参数配置
|
|
54
|
-
|
|
55
|
-
| Property | Type | Description | Default |
|
|
56
|
-
| ---------------- | ------ | ----------------------------------------------------------------------------- | --------- |
|
|
57
|
-
| cesiumGlobal | Object | Cesium 对象 | undefined |
|
|
58
|
-
| threeGlobal | Object | THREE 对象 | undefined |
|
|
59
|
-
| containerId | String | Cesium 挂载 dom 容器 id | undefined |
|
|
60
|
-
| threeContainerId | String | Three 挂载 dom 容器 id | undefined |
|
|
61
|
-
| viewerConfig | Object | viewer 基础配置(与官网一致) | {} |
|
|
62
|
-
| extreaConfig | Object | 额外参数配置,如 {logo:true// 是否显示 logo, depthTest:true //开启深度检测} | {} |
|
|
63
|
-
| MapImageryList | Array | 配置底图,参考 ImageryProvider | [] |
|
|
64
|
-
| defaultStatic | Array | 着色器使用的静态资源配置(如图片 url) | undefined |
|
|
65
|
-
|
|
66
|
-
### 1.2 initCesium 返回对象
|
|
67
|
-
|
|
68
|
-
| name | Type | Description |
|
|
69
|
-
| ------------------ | ------ | ------------------------------------------------ |
|
|
70
|
-
| viewer | Object | Cesium 实例对象 |
|
|
71
|
-
| material | Object | 材质模块(修改实体材质) |
|
|
72
|
-
| graphics | Object | 图形模块(如创建 PolygonGraphics 对象等) |
|
|
73
|
-
| math3d | Object | 三维数学工具 |
|
|
74
|
-
| primitive | Object | 图元操作对象(如使用 primivite 创建 polygon 等) |
|
|
75
|
-
| draw | Object | 绘制模块(如多边形,矩形) |
|
|
76
|
-
| passEffect | Object | 后置处理模块 |
|
|
77
|
-
| customCesiumPlugin | Object | 自定义传感器扩展 |
|
|
78
|
-
| control | Object | 控制模块(如模型位置调整,拖拽等) |
|
|
79
|
-
| plugin | Object | 额外插件(如拓展 css3 的动画 ,地形裁剪) |
|
|
80
|
-
| base | Object | 基础模块(如坐标转换,图层初始化等) |
|
|
81
|
-
| analysis | Object | 分析模块(如坡度,坡向,可视域,通视分析) |
|
|
82
|
-
| attackArrowObj | Object | 标绘(攻击) |
|
|
83
|
-
| straightArrowObj | Object | 标绘(直击) |
|
|
84
|
-
| pincerArrowObj | Object | 标绘(钳击) |
|
|
85
|
-
| ThreeJs | Object | 集成 ThreeJS 扩展对象 |
|
|
86
|
-
|
|
87
|
-
### 1.3 使用案例
|
|
88
|
-
|
|
89
|
-
```javaScript
|
|
90
|
-
// test.vue
|
|
91
|
-
<template>
|
|
92
|
-
<div id="cesiumContainer" class="map3d-contaner"></div>
|
|
93
|
-
</template>
|
|
94
|
-
<script>
|
|
95
|
-
import { initCesium } from 'cesium_dev_kit'
|
|
96
|
-
import { defaultStatic } from '../defaultStaticConf'
|
|
97
|
-
export default {
|
|
98
|
-
mounted() {
|
|
99
|
-
this.initMap()
|
|
100
|
-
},
|
|
101
|
-
methods: {
|
|
102
|
-
initMap() {
|
|
103
|
-
const tempData = [
|
|
104
|
-
{
|
|
105
|
-
id: 3,
|
|
106
|
-
name: '高德地图02',
|
|
107
|
-
type: 'UrlTemplateImageryProvider',
|
|
108
|
-
classConfig: {
|
|
109
|
-
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
|
110
|
-
},
|
|
111
|
-
interfaceConfig: {},
|
|
112
|
-
offset: '0,0',
|
|
113
|
-
invertswitch: 0,
|
|
114
|
-
filterRGB: '#ffffff',
|
|
115
|
-
showswitch: 1,
|
|
116
|
-
weigh: 13,
|
|
117
|
-
createtime: 1624346908,
|
|
118
|
-
updatetime: 1647395260,
|
|
119
|
-
}
|
|
120
|
-
]
|
|
121
|
-
const { viewer,material,graphics} =
|
|
122
|
-
new initCesium({
|
|
123
|
-
cesiumGlobal: Cesium,
|
|
124
|
-
containerId: 'cesiumContainer',
|
|
125
|
-
viewerConfig: {
|
|
126
|
-
infoBox: false,
|
|
127
|
-
shouldAnimate: true,
|
|
128
|
-
},
|
|
129
|
-
extraConfig: {
|
|
130
|
-
depthTest: true
|
|
131
|
-
},
|
|
132
|
-
MapImageryList: tempData,
|
|
133
|
-
defaultStatic
|
|
134
|
-
})
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
</script>
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### 2、按需引入
|
|
142
|
-
|
|
143
|
-
可根据功能需求导出单一扩展类,减少代码冗余
|
|
144
|
-
|
|
145
|
-
```javaScript
|
|
146
|
-
import {Graphics, Material,Primitive,Draw,Analysis,CustomCesiumPlugin,PassEffect,Plugin,ThreeJs} from 'cesium_dev_kit'
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### 2.1 扩展类:
|
|
150
|
-
|
|
151
|
-
- Graphics:各种图形操作
|
|
152
|
-
- Material: 材质操作
|
|
153
|
-
- Primitive: 配合 shader 的各种图元操作
|
|
154
|
-
- Draw: 各种绘制对象
|
|
155
|
-
- Analysis: 各种分析对象
|
|
156
|
-
- CustomCesiumPlugin: 自定义相控扩展
|
|
157
|
-
- PassEffect: 后期特效对象
|
|
158
|
-
- Plugin: 各种扩展功能
|
|
159
|
-
- ThreeJs: 集成 ThreeJS 扩展对象
|
|
160
|
-
|
|
161
|
-
### 2.2 Draw 使用案例:
|
|
162
|
-
|
|
163
|
-
```javaScript
|
|
164
|
-
// test.vue
|
|
165
|
-
<template>
|
|
166
|
-
<div id="cesiumContainer" class="map3d-contaner"></div>
|
|
167
|
-
</template>
|
|
168
|
-
<script>
|
|
169
|
-
import { Draw } from 'cesium_dev_kit'
|
|
170
|
-
export default {
|
|
171
|
-
mounted() {
|
|
172
|
-
this.initMap()
|
|
173
|
-
},
|
|
174
|
-
methods: {
|
|
175
|
-
initMap() {
|
|
176
|
-
const tempData = [
|
|
177
|
-
{
|
|
178
|
-
id: 3,
|
|
179
|
-
name: '高德地图02',
|
|
180
|
-
type: 'UrlTemplateImageryProvider',
|
|
181
|
-
classConfig: {
|
|
182
|
-
url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
|
|
183
|
-
},
|
|
184
|
-
interfaceConfig: {},
|
|
185
|
-
offset: '0,0',
|
|
186
|
-
invertswitch: 0,
|
|
187
|
-
filterRGB: '#ffffff',
|
|
188
|
-
showswitch: 1,
|
|
189
|
-
weigh: 13,
|
|
190
|
-
createtime: 1624346908,
|
|
191
|
-
updatetime: 1647395260,
|
|
192
|
-
}]
|
|
193
|
-
|
|
194
|
-
const drawObj = new Draw({
|
|
195
|
-
cesiumGlobal: Cesium, // 全局Cesium对象
|
|
196
|
-
containerId: 'cesiumContainer', // 容器id
|
|
197
|
-
viewerConfig: { // 同官方的viewer配置相同
|
|
198
|
-
infoBox: false,
|
|
199
|
-
shouldAnimate: true,
|
|
200
|
-
},
|
|
201
|
-
extraConfig: {// 其他配置
|
|
202
|
-
logo:true, // 是否显示logo
|
|
203
|
-
depthTest:true // 是否开启深度测试
|
|
204
|
-
},
|
|
205
|
-
MapImageryList: tempData // 底图配置
|
|
206
|
-
defaultStatic // 默认服务器地址以及材质等基础信息配置,具体请参考src\views\example\defaultStaticConf\index.js
|
|
207
|
-
})
|
|
208
|
-
|
|
209
|
-
this.c_viewer = drawObj.viewer
|
|
210
|
-
this.draw = drawObj.draw
|
|
211
|
-
this.draw.setDefSceneConfig()
|
|
212
|
-
this.draw.setBloomLightScene()
|
|
213
|
-
this.load3dTiles(drawObj.viewer)
|
|
214
|
-
|
|
215
|
-
this.StraightArrowObj = drawObj.straightArrowObj
|
|
216
|
-
this.AttackArrowObj = drawObj.attackArrowObj
|
|
217
|
-
this.PincerArrowObj = drawObj.pincerArrowObj
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
</script>
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### 如需在 H5 中使用
|
|
225
|
-
|
|
226
|
-
- html 中直接引入 index.umd.js
|
|
227
|
-
|
|
228
|
-
```javaScript
|
|
229
|
-
<script type="text/javascript" src="index.umd.js"></script>
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
- 初始化对象
|
|
233
|
-
|
|
234
|
-
```javaScript
|
|
235
|
-
new cesium_dev_kit.initCesium({...})
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
## 使用范例
|
|
239
|
-
|
|
240
|
-
- ES6 使用案例
|
|
241
|
-
[https://github.com/dengxiaoning/cesium_kit_test](https://github.com/dengxiaoning/cesium_kit_test)
|
|
242
|
-
|
|
243
|
-
- H5 使用案例
|
|
244
|
-
[https://github.com/dengxiaoning/cesium_kit_test_h5](https://github.com/dengxiaoning/cesium_kit_test_h5)
|
|
245
|
-
|
|
246
|
-
##
|
|
247
|
-
|
|
248
|
-
## 浏览器支持
|
|
249
|
-
|
|
250
|
-
本地开发推荐使用`Chrome 80+` 浏览器
|
|
251
|
-
|
|
252
|
-
支持现代(chrome,Firefox,Microsoft edge,etc.)浏览器, 不支持 IE
|
|
253
|
-
|
|
254
|
-
## 鸣谢
|
|
255
|
-
|
|
256
|
-
[cesium-d3kit](https://github.com/zhangti0708/cesium-d3kit)<br/>
|
|
257
|
-
[drawarrowforcesium](https://gitcode.net/mirrors/gitgitczl/drawarrowforcesium)<br/>
|
|
258
|
-
[vue3-ts-cesium-map-show](https://gitee.com/hawk86104/vue3-ts-cesium-map-show)<br/>
|
|
259
|
-
|
|
260
|
-
本项目包括但不限于借鉴和参考以上资料,非常感谢作者分享
|
|
261
|
-
|
|
262
|
-
## 项目不足与优化
|
|
263
|
-
|
|
264
|
-
- 1、扩展类未使用类型检测(TS)
|
|
265
|
-
- 2、未配备使用文档(请参考案例)
|
|
266
|
-
- 3、未作异常捕捉和处理
|
|
267
|
-
|
|
268
|
-
## 如何贡献
|
|
269
|
-
|
|
270
|
-
<a href="https://github.com/dengxiaoning/cesium_dev_kit/graphs/contributors">
|
|
271
|
-
<img src="https://contrib.rocks/image?repo=dengxiaoning/cesium_dev_kit" />
|
|
272
|
-
</a>
|
|
273
|
-
|
|
274
|
-
你可以[提一个 issue](https://github.com/dengxiaoning/cesium_dev_kit/issues/new) 或者提交一个 Pull Request。
|
|
275
|
-
|
|
276
|
-
**Pull Request:**
|
|
277
|
-
|
|
278
|
-
1. Fork 代码
|
|
279
|
-
2. 创建自己的分支: `git checkout -b feat/xxxx`
|
|
280
|
-
3. 提交你的修改: `git commit -am 'feat(function): add xxxxx'`
|
|
281
|
-
4. 推送您的分支: `git push origin feat/xxxx`
|
|
282
|
-
5. 提交 `pull request`
|
|
283
|
-
|
|
284
|
-
## Git 贡献提交规范
|
|
285
|
-
|
|
286
|
-
- `feat` 新功能
|
|
287
|
-
- `fix` 修补 bug
|
|
288
|
-
- `docs` 文档
|
|
289
|
-
- `style` 格式、样式(不影响代码运行的变动)
|
|
290
|
-
- `refactor` 重构(即不是新增功能,也不是修改 BUG 的代码)
|
|
291
|
-
- `perf` 优化相关,比如提升性能、体验
|
|
292
|
-
- `test` 添加测试
|
|
293
|
-
- `build` 编译相关的修改,对项目构建或者依赖的改动
|
|
294
|
-
- `ci` 持续集成修改
|
|
295
|
-
- `chore` 构建过程或辅助工具的变动
|
|
296
|
-
- `revert` 回滚到上一个版本
|
|
297
|
-
- `workflow` 工作流改进
|
|
298
|
-
- `mod` 不确定分类的修改
|
|
299
|
-
- `wip` 开发中
|
|
300
|
-
- `types` 类型
|
|
301
|
-
|
|
302
|
-
<small>欢迎感兴趣朋友加入一起完善功能,让工作效更高效、开发更简单、生活更惬意。</small>
|
|
303
|
-
|
|
304
|
-
## `Star`
|
|
305
|
-
|
|
306
|
-
非常感谢留下星星的好心人,感谢您的支持 :heart:
|
|
307
|
-
|
|
308
|
-
[![Stargazers repo roster for @dengxiaoning/cesium_dev_kit][stargazers-url]][stargazers-link]
|
|
309
|
-
|
|
310
|
-
## `Fork`
|
|
311
|
-
|
|
312
|
-
@sincely、`@ooil929`、 @InPanda、 `luyufanzhi`、AllenChiangCN、`Liquid-Zhangliquan` :heart:
|
|
313
|
-
|
|
314
|
-
[![Forkers repo roster for @dengxiaoning/cesium_dev_kit][forkers-url]][forkers-link]
|
|
315
|
-
|
|
316
|
-
[npm]: https://img.shields.io/npm/v/cesium_dev_kit
|
|
317
|
-
[npm-url]: https://www.npmjs.com/package/cesium_dev_kit
|
|
318
|
-
[build-size]: https://img.shields.io/bundlephobia/minzip/cesium_dev_kit/1.0.70?logo=travis
|
|
319
|
-
[build-size-url]: https://img.shields.io/bundlephobia/minzip/cesium_dev_kit
|
|
320
|
-
[npm-download]: https://img.shields.io/npm/dt/cesium_dev_kit?logo=npm
|
|
321
|
-
[npmtrends-url]: https://www.npmtrends.com/cesium_dev_kit
|
|
322
|
-
[license-uri]: https://img.shields.io/npm/l/cesium_dev_kit.svg
|
|
323
|
-
[license-link]: https://npm.im/cesium_dev_kit
|
|
324
|
-
[build-status]: https://github.com/dengxiaoning/cesium_dev_kit
|
|
325
|
-
[build-main]: https://img.shields.io/github/actions/workflow/status/dengxiaoning/cesium_dev_kit/project-build.yml?branch=main&logo=github
|
|
326
|
-
[repo-stars]: https://img.shields.io/github/stars/dengxiaoning/cesium_dev_kit?style=plastic&logo=github
|
|
327
|
-
[forkers-url]: https://bytecrank.com/nastyox/reporoster/php/forkersSVG.php?user=dengxiaoning&repo=cesium_dev_kit
|
|
328
|
-
[forkers-link]: https://github.com/dengxiaoning/cesium_dev_kit/network/members
|
|
329
|
-
[stargazers-url]: https://bytecrank.com/nastyox/reporoster/php/stargazersSVG.php?user=dengxiaoning&repo=cesium_dev_kit
|
|
330
|
-
[stargazers-link]: https://github.com/dengxiaoning/cesium_dev_kit/stargazers
|
|
331
|
-
[star-chart]: https://api.star-history.com/svg?repos=dengxiaoning/cesium_dev_kit&type=Date
|