Skip to content

Commit

Permalink
fix: does not work properly on the mars3d platform
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyaoji committed Aug 12, 2022
1 parent 6eeec48 commit da89520
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ _2022-08-12_

#### Bug 修复

- Fix some incorrect types definitions.
- Fix the problem of failing to get viewer through useVueCesium.
- Fixed some incorrect types definitions.
- Fixed the problem that failing to get viewer through useVueCesium.
- Fixed the problem that the vc-overview-map component does not work properly on the mars3d platform.

### 3.0.16

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ _2022-08-12_

- 修复部分 types 定义不正确的问题。
- 修复非子组件情况下通过 useVueCesium 获取 viewer 失败的问题。
- 修复在 mars3d 平台鹰眼组件不正常问题。

### 3.0.16

Expand Down
3 changes: 2 additions & 1 deletion packages/components/controls/vc-overview-map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export default defineComponent({
{
removeCesiumScript: false,
showCredit: false,
sceneMode: 2
sceneMode: 2,
containerId: 'vc-overview-map'
},
props.viewerOpts
)
Expand Down
5 changes: 4 additions & 1 deletion packages/components/viewer/src/useViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,10 @@ export default function (props: VcViewerProps, ctx, vcInstance: VcComponentInter
viewer = props.viewerCreator(vcInstance, $(viewerRef), options)
} else {
if (globalThis.mars3d) {
vcInstance.map = new mars3d.Map($(viewerRef).id, options)
vcInstance.map = new mars3d.Map($(viewerRef).id, {
scene: options,
control: options
})
viewer = vcInstance.map?._viewer
} else if (globalThis.DC) {
vcInstance.dcViewer = new DC.Viewer($(viewerRef).id, options)
Expand Down
18 changes: 15 additions & 3 deletions website/docs/zh-CN/platforms/vc-demo-mars3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ app.mount('#app')
<el-row ref="viewerContainer" class="demo-viewer">
<vc-viewer
ref="vcViewer"
:mars3d-config="mars3dConfig"
:mars3d-config="viewerOpts.mars3dConfig"
:animation="animation"
:timeline="timeline"
:fullscreenButton="fullscreenButton"
Expand All @@ -53,6 +53,16 @@ app.mount('#app')
<vc-layer-imagery :sort-order="10">
<vc-imagery-provider-tianditu map-style="img_c" token="436ce7e50d27eede2f2929307e6b33c0"></vc-imagery-provider-tianditu>
</vc-layer-imagery>
<vc-overview-map ref="overview" :viewerOpts="viewerOpts" :offset="[5, 120]" position="bottom-left">
<!-- 天地图注记 -->
<vc-layer-imagery :sort-order="20">
<vc-imagery-provider-tianditu map-style="cva_c" token="436ce7e50d27eede2f2929307e6b33c0"></vc-imagery-provider-tianditu>
</vc-layer-imagery>
<!-- 天地图影像 -->
<vc-layer-imagery :sort-order="10">
<vc-imagery-provider-tianditu map-style="img_c" token="436ce7e50d27eede2f2929307e6b33c0"></vc-imagery-provider-tianditu>
</vc-layer-imagery>
</vc-overview-map>
</vc-viewer>
<el-row class="demo-toolbar">
<el-row>
Expand Down Expand Up @@ -85,8 +95,10 @@ app.mount('#app')
offset: [0, 32],
position: 'bottom-right'
},
mars3dConfig: {
include: 'mars3d'
viewerOpts: {
mars3dConfig: {
include: 'mars3d'
}
}
}
},
Expand Down

0 comments on commit da89520

Please sign in to comment.