cesium_dev_kit 1.0.51 → 1.0.53

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.
Files changed (2) hide show
  1. package/README.md +234 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,234 @@
1
+ <p align="center">
2
+ <a href="https://npmjs.com/package/node"><img src="https://img.shields.io/node/v/vite.svg" alt="node compatility"></a>
3
+ <a href="https://npmjs.com/package/npm"><img src="https://img.shields.io/badge/npm-v6.14.10-blue" alt="npm package"></a>
4
+ <a href="https://npmjs.com/package/vue"><img src="https://img.shields.io/badge/vue-v3.0.5-success" alt="vue package"></a>
5
+ <a href="https://npmjs.com/package/vite"><img src="https://img.shields.io/badge/vite-v2.6.10-blue" alt="vite package"></a>
6
+ <a href="https://jestjs.io"><img src="https://github.com/openlayers/openlayers/workflows/Test/badge.svg" alt="Test Status"></a>
7
+ </p>
8
+
9
+ ## cesium_dev_kit
10
+
11
+ ## 简介
12
+
13
+ 旨在封装一个 Cesium 基本操作的工具包,提供简单的方法调用来实现复杂的 API 操作;达到节省阅读 Cesium 原文档时间,从而降低入门难度提升学习信心,同时也希望能提高工作效率减少重复劳动;案例中封装了常用功能配备使用案例,npm 安装后可以直接在项目中使用。
14
+
15
+ ## 目录结构
16
+
17
+ ```md
18
+ ├── public # 静态资源
19
+ │ ├── static # 模型文件
20
+ │ │ ├── data # 3dtiles 及 model
21
+ | └── favicon.ico # favicon 图标
22
+ ├── src # 源代码
23
+ | ├── api # api 请求
24
+ | ├── assets # 主题 变量等资源
25
+ | | ├── scss # scss 变量
26
+ | | └──theme # elemet 主题
27
+ | ├── libs
28
+ | | ├── directive # 全局指令
29
+ | | └──element.ts # elemet 全局样式重写
30
+ | ├──components # 全局公共组件
31
+ | ├──hooks # 全局 hooks
32
+ | ├── config # 全局公共配置
33
+ | ├── layout # 全局 layout
34
+ | ├── locale # 国际化
35
+ | ├── plugin # 三方插件
36
+ | ├── router # 全局路由
37
+ | ├── store # 全局 vuex
38
+ | ├── utils # 全局公用方法
39
+ | | └──cesiumPluginsExtends # cesium 扩展工具包
40
+ | ├── views # 所有页面
41
+ | | └──example # cesium 扩展工具包案例
42
+ | ├── App.tsx # 入口页面
43
+ | ├── main.ts # 入口文件
44
+ | ├── permission.ts #权限认证
45
+ | └── shims-vue.d.ts # ts 声明文件
46
+ ├── static # 静态资源
47
+ | ├── img # img
48
+ | └── svg # svg
49
+ ├── .editorconfig # editorconfig
50
+ ├── .env.development # 环境变量 开发
51
+ ├── .env.production # 环境变量 生产
52
+ ├── .eslintignore # eslintignore
53
+ ├── .eslintrc.js # eslint 配置项
54
+ ├── .gitignore # gitignore
55
+ ├── .babelrc # babel 配置项
56
+ ├── index.html # html 模板
57
+ ├── package.json # package.json
58
+ ├── README.md # README
59
+ ├── tsconfig.json # tsconfig
60
+ └── vite.config.ts # vite 配置文件
61
+ ```
62
+
63
+ ##
64
+
65
+ ## 项目演示
66
+
67
+ - 材质
68
+ ![material](https://github.com/dengxiaoning/cesium_dev_kit/blob/master/src/assets/image/preview/material.gif)
69
+ - 分析
70
+ ![analysis](https://github.com/dengxiaoning/cesium_dev_kit/blob/master/src/assets/image/preview/analysis.gif)
71
+ - 标绘
72
+ ![plot](https://github.com/dengxiaoning/cesium_dev_kit/blob/master/src/assets/image/preview/plot.gif)
73
+ - 拖拽
74
+ ![drag](https://github.com/dengxiaoning/cesium_dev_kit/blob/master/src/assets/image/preview/drag.gif)
75
+ - 雷达扫描
76
+ ![radar](https://github.com/dengxiaoning/cesium_dev_kit/blob/master/src/assets/image/preview/radar.gif)
77
+
78
+ ## 在线预览
79
+
80
+ [https://www.benpaodehenji.com/cesiumDevKit](https://www.benpaodehenji.com/cesiumDevKit)
81
+
82
+ ## 项目安装与使用
83
+
84
+ - 1、直接运行本案例项目
85
+
86
+ ```
87
+ c:\> git clone https://github.com/dengxiaoning/cesium_dev_kit.git
88
+ c:\> cd cesium_dev_kit
89
+ c:\> npm install
90
+ c:\> npm run dev
91
+
92
+ ```
93
+
94
+ - 2、作为 libs 安装到已有项目中
95
+
96
+ ```shell
97
+
98
+ c:\> npm install cesium_dev_kit
99
+
100
+ ```
101
+
102
+ - 2.1、项目中使用案例
103
+
104
+ ```javaScript
105
+ // test.vue
106
+ <template>
107
+ <div id="cesiumContainer"
108
+ class="map3d-contaner"></div>
109
+ </template>
110
+ <script>
111
+ import { initCesium } from 'cesium_dev_kit'
112
+ export default {
113
+ mounted() {
114
+ this.initMap()
115
+ },
116
+ methods: {
117
+ initMap() {
118
+ const {
119
+ viewer, // viewer
120
+ material, // 材质模块(修改实体材质)
121
+ graphics, // 图形模块(如创建PolygonGraphics对象等)
122
+ math3d, // 三维数学工具
123
+ primitive, // 图元操作对象(如使用primivite创建polygon等)
124
+ draw, // 绘制模块(如多边形,矩形)
125
+ passEffect, // 后置处理模块
126
+ customCesiumPlugin,
127
+ control, // 控制模块(如模型位置调整,拖拽等)
128
+ plugin, // 额外插件(如拓展css3的动画 ,地形裁剪)
129
+ base, // 基础模块(如坐标转换,图层初始化等)
130
+ analysis, // 分析模块(如坡度,坡向,可视域,通视分析)
131
+ attackArrowObj, // 标绘(攻击)
132
+ straightArrowObj,// 标绘(直击)
133
+ pincerArrowObj, // 标绘(钳击)
134
+ } = new initCesium(
135
+ {
136
+ cesiumGlobal: Cesium,
137
+ containerId: 'cesiumContainer',
138
+ viewerConfig: {
139
+ infoBox: false,
140
+ shouldAnimate: true,
141
+ },
142
+ extraConfig: {},
143
+ MapImageryList: []
144
+ })
145
+ }
146
+ }
147
+ }
148
+ </script>
149
+ ```
150
+
151
+ - 2.2、initCesium({}) 参数说明
152
+
153
+ ```javaScript
154
+ /**
155
+ * 初始化入口函数
156
+ * @param {*} param0
157
+ * {
158
+ * cesiumGlobal:{Object} Ceiusm对象(项目需要安装配置获取Cesium传入)
159
+ * containerId:{String} 容器id
160
+ * viewerConfig:{Object} viewer基础配置
161
+ * 【参数格式】:{与官网一致}
162
+ * extreaConfig:{Object }
163
+ * 【参数格式】:
164
+ * {
165
+ * logo:true,// 是否显示logo
166
+ * depthTest:true, //开启深度检测
167
+ * }
168
+ * MapImageryList:{Array} 配置底图,每一个元素格式为
169
+ * 【参数格式】 :
170
+ * [{
171
+ * id: 3,
172
+ * name: '',
173
+ * type: '',//ImageryProvider类型
174
+ * classConfig: {
175
+ * url: 链接地址
176
+ * },
177
+ * interfaceConfig: {},
178
+ * offset: '0,0',
179
+ * invertswitch: 0,
180
+ * filterRGB: '#ffffff',
181
+ * showswitch: 1,
182
+ * weight: 13,
183
+ * createtime: 创建时间
184
+ * updatetime: 更新时间,
185
+ * }]
186
+ *
187
+ * }
188
+ * @returns
189
+ */
190
+ ```
191
+
192
+ - 2.3、NPM 安装引入案例
193
+
194
+ [https://github.com/dengxiaoning/cesium_kit_test](https://github.com/dengxiaoning/cesium_kit_test)这是一个 vue 项目已安装 cesium_dev_kit,其中有使用 demo,可直接下载到本地运行查看参照
195
+
196
+ ##
197
+
198
+ ## 浏览器支持
199
+
200
+ 本地开发推荐使用`Chrome 80+` 浏览器
201
+
202
+ 支持现代(chrome,Firefox,Microsoft edge,etc.)浏览器, 不支持 IE
203
+
204
+ ## CesiumGlsl 文档
205
+
206
+ ```
207
+ https://cesium.com/downloads/cesiumjs/releases/b23/Documentation/index.html
208
+
209
+ ```
210
+
211
+ ## iconify 使用方法
212
+
213
+ [官网 https://icon-sets.iconify.design](https://icon-sets.iconify.design)
214
+
215
+ ```
216
+
217
+ <CIcon icon-class="bx:time-five" icon-color="#333" />
218
+
219
+ ```
220
+
221
+ ## 鸣谢
222
+
223
+ [cesium-d3kit](https://github.com/zhangti0708/cesium-d3kit)<br/>
224
+ [drawarrowforcesium](https://gitcode.net/mirrors/gitgitczl/drawarrowforcesium)<br/>
225
+ [vue3-ts-cesium-map-show](https://gitee.com/hawk86104/vue3-ts-cesium-map-show)<br/>
226
+ 本项目借鉴和参考以上几个资料文件,非常感谢作者分享
227
+
228
+ ## 项目不足与优化
229
+
230
+ - 1、cesium 工具类未使用 typeScript
231
+ - 2、未配备使用文档(请参考案例)
232
+ - 3、未作异常捕捉和处理
233
+
234
+ <small>感兴趣朋友可以一起讨论交流继续完善功能,提升自己帮助他人。欢迎进行 fork,同时也请给个 star 以示鼓励谢谢。</small>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cesium_dev_kit",
3
- "version": "1.0.51",
3
+ "version": "1.0.53",
4
4
  "description": "本项目是一个封装 Cesium 基本操作的工具包,提供简单的方法调用来实现复杂的 API 操作;节省阅读 Cesium 原文档时间,从而降低入门难度增加学习信心,同时也希望能提高工作效率",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "url": "git+https://github.com/dengxiaoning/cesium_dev_kit.git"
13
13
  },
14
14
  "keywords": [
15
- "cesiumDevKit"
15
+ "webgl glsl 3D map geospatial cesium shader"
16
16
  ],
17
17
  "author": "dengxiaoning",
18
18
  "license": "ISC",