chbim-plugins 0.0.103 → 0.0.104
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 +71 -0
- package/package.json +5 -2
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
````
|
|
2
|
+
<br />
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="#">
|
|
6
|
+
<img src="https://chbim.ccshcc.cn/baseResources//Logo/Logo.png" alt="Logo" height="60">
|
|
7
|
+
</a>
|
|
8
|
+
<h3 align="center">基于<font color="#4bbbef"> CHBIM云平台 </font>服务的插件</h3>
|
|
9
|
+
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
## 使用指南
|
|
13
|
+
|
|
14
|
+
1. 此插件和 CHBIM 强绑定
|
|
15
|
+
2. node 版本>=16.14.2
|
|
16
|
+
|
|
17
|
+
#### 安装
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm i chbim-plugins
|
|
21
|
+
````
|
|
22
|
+
|
|
23
|
+
#### 引入
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
import "chbim-plugins/style.css";
|
|
27
|
+
import { ChbimPlugins } from "chbim-plugins";
|
|
28
|
+
......
|
|
29
|
+
......
|
|
30
|
+
......
|
|
31
|
+
app.use(ChbimPlugins);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### 使用
|
|
35
|
+
|
|
36
|
+
在需要使用的.vue 文件里面引入
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
import {
|
|
40
|
+
BimTerrainProvider, // 地形
|
|
41
|
+
BimElevationImage, // 瓦片
|
|
42
|
+
BimModel, // 模型
|
|
43
|
+
BimVector, // 矢量
|
|
44
|
+
BimEntity, // 注记
|
|
45
|
+
PanoramicView, // 全景图
|
|
46
|
+
......
|
|
47
|
+
} from "chbim-plugins";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
添加模型为例:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
/* data 为模型树的扁平化json */
|
|
54
|
+
window.bimModel = new BimModel(data);
|
|
55
|
+
|
|
56
|
+
/* 给地图添加模型
|
|
57
|
+
** id => 模型id
|
|
58
|
+
** fn => 自定义注册事件
|
|
59
|
+
*/
|
|
60
|
+
window.bimModel.add(id,fn).then((e) => {
|
|
61
|
+
if (e.type == "error") {
|
|
62
|
+
console.error('失败')
|
|
63
|
+
}
|
|
64
|
+
}).catch((e) => {
|
|
65
|
+
console.error('失败')
|
|
66
|
+
})
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 版本控制
|
|
70
|
+
|
|
71
|
+
该项目使用 Git 进行版本管理。
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chbim-plugins",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.104",
|
|
5
5
|
"description": "一个简单的组件库",
|
|
6
6
|
"main": "chbim-plugins.js",
|
|
7
|
-
"keywords": [
|
|
7
|
+
"keywords": [
|
|
8
|
+
"vue",
|
|
9
|
+
"Cesium"
|
|
10
|
+
],
|
|
8
11
|
"author": "zhang",
|
|
9
12
|
"license": "ISC"
|
|
10
13
|
}
|