Skip to content

Commit

Permalink
docs: updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyaoji committed Aug 3, 2022
1 parent f21fa46 commit 7313d55
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ _2022-08-03_
- Fixed a bug that some css was wrong.
- Fixed a bug that drawing circles and regular polygons is incorrect in 2D mode.

#### Breaking changes:

- Changed the access method of mars3d, configured via `mars3dConfig`. For details, see [vc-demo-mars3d](https://zouyaoji.top/vue-cesium/#/en-US/component/platforms/vc-demo-mars3d)

### 3.0.15

_2022-07-23_
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ _2022-08-03_
- 修复部分 css 不正确的问题。
- 修复二维模式下绘制圆、正多边形结果不正确的问题。

#### 破坏性更新

- 引入 mars3d 的方式改变,通过 `mars3dConfig` 来配置。 详见 [vc-demo-mars3d](https://zouyaoji.top/vue-cesium/#/zh-CN/component/platforms/vc-demo-mars3d)

### 3.0.15

_2022-07-23_
Expand Down
18 changes: 9 additions & 9 deletions website/docs/en-US/platforms/vc-demo-mars3d.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Mars3D Demo

When vue-cesium uses Mars3D of Mars Technology to develop, you only need to specify the address of the **directory** of the mars3d library through the configuration item `cesiumPath` when VueCesium is introduced.
When vue-cesium uses [Mars3D](http://mars3d.cn/) of Mars Technology, it is only necessary to configure the address of the mars3d main library and its plug-in library through the configuration item `mars3dConfig` when introducing VueCesium, and the default use of unpkg.com cdn resources, if you need to use it locally or in the local area network, please change the resources of the relevant library to the local or local area network address through `mars3dConfig.libs`.Please [Reference](https://github.com/zouyaoji/vue-cesium/blob/dev/packages/components/viewer/src/loadUtil.ts#L17) for non-TS project structure.

```javascript
import { createApp } from 'vue'
Expand All @@ -10,16 +10,14 @@ import App from './App.vue'

const app = createApp(App)
app.use(VueCesium, {
cesiumPath: 'https://mars3d.cn/lib/',
// The resource library to be imported, optional. If not specified, only the necessary resources of mars3d will be loaded
cfg: {
include: 'turf,mars3d'
mars3dConfig: {
include: 'mars3d'
}
})
} as ConfigProviderContext)
app.mount('#app')
```

Or specify the address of `cesiumPath` as the **directory** of the mars3d library on the `vc-viewer` component.
Or configure `mars3dConfig` on the `vc-viewer` component.

If `vc-viewer` is loaded successfully, it will return { Cesium, viewer, map }, through this `map` use [mars3d tutorial](http://mars3d.cn/doc.html) and [mars3d API](http:// mars3d.cn/api/) for related development, such as the following example:

Expand All @@ -33,7 +31,7 @@ Use VueCesium to load Mars Technology Mars3D
<el-row ref="viewerContainer" class="demo-viewer">
<vc-viewer
ref="vcViewer"
:cesiumPath="cesiumPath"
:mars3d-config="mars3dConfig"
:animation="animation"
:timeline="timeline"
:fullscreenButton="fullscreenButton"
Expand Down Expand Up @@ -81,7 +79,9 @@ Use VueCesium to load Mars Technology Mars3D
offset: [0, 32],
position: 'bottom-right'
},
cesiumPath: 'https://mars3d.cn/lib/'
mars3dConfig: {
include: 'mars3d'
}
}
},
mounted() {
Expand Down
19 changes: 10 additions & 9 deletions website/docs/zh-CN/platforms/vc-demo-mars3d.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
## Mars3D Demo

vue-cesium 使用火星科技的 [Mars3D](http://mars3d.cn/) 开发时只需要在引入 VueCesium 时通过配置项 `cesiumPath` 指定为 mars3d 库的**目录**地址
vue-cesium 使用火星科技的 [Mars3D](http://mars3d.cn/) 开发时只需要在引入 VueCesium 时通过配置项 `mars3dConfig` 配置 mars3d 主库和其插件库地址,默认使用 unpkg.com 的 cdn 资源,如需本地或局域网使用,请通过 mars3dConfig.libs 将相关库的资源改为本地或局域网地址即可。非 TS 项目结构请 [参考](https://github.com/zouyaoji/vue-cesium/blob/dev/packages/components/viewer/src/loadUtil.ts#L17)

```javascript
```typescript
import { createApp } from 'vue'
import VueCesium from 'vue-cesium'
import 'vue-cesium/dist/index.css'
import App from './App.vue'

const app = createApp(App)
app.use(VueCesium, {
cesiumPath: 'https://mars3d.cn/lib/',
// 要引入的资源库,可选。不指定的话只加载 mars3d 必要资源
cfg: {
include: 'turf,mars3d'
mars3dConfig: {
include: 'mars3d'
}
})
} as ConfigProviderContext)
app.mount('#app')
```

或者在 `vc-viewer` 组件上将 `cesiumPath` 地址指定为 mars3d 库的**目录**
或者在 `vc-viewer` 组件上配置 `mars3dConfig`

`vc-viewer` 加载成功会返回 { Cesium, viewer, map }, 通过该 `map` 使用 [mars3d 教程](http://mars3d.cn/doc.html)[mars3d API](http://mars3d.cn/api/) 进行相关开发即可, 如下面的例子:

Expand All @@ -33,7 +32,7 @@ app.mount('#app')
<el-row ref="viewerContainer" class="demo-viewer">
<vc-viewer
ref="vcViewer"
:cesiumPath="cesiumPath"
:mars3d-config="mars3dConfig"
:animation="animation"
:timeline="timeline"
:fullscreenButton="fullscreenButton"
Expand Down Expand Up @@ -86,7 +85,9 @@ app.mount('#app')
offset: [0, 32],
position: 'bottom-right'
},
cesiumPath: 'https://mars3d.cn/lib/'
mars3dConfig: {
include: 'mars3d'
}
}
},
mounted() {
Expand Down

0 comments on commit 7313d55

Please sign in to comment.