优化代码
parent
9806553242
commit
6ed9ebc1f6
|
@ -1,9 +1,7 @@
|
|||
<template>
|
||||
<vc-viewer class="vc-viewer" :animation="true" :showCredit="false" :shouldAnimate="true" :sceneModePicker="true" @ready="onViewerReady">
|
||||
<vc-layer-imagery>
|
||||
<vc-provider-imagery-singletile
|
||||
:url="earth"
|
||||
></vc-provider-imagery-singletile>
|
||||
<vc-provider-imagery-singletile :url="earth" />
|
||||
</vc-layer-imagery>
|
||||
|
||||
<vc-navigation :offset="[10, 40]" :position="'top-left'" :printOpts="false" :locationOpts="false" :otherOpts="false" />
|
||||
|
@ -15,8 +13,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import earth from '../assets/earth.jpg'
|
||||
import entity from '../api/entity'
|
||||
import earth from '../assets/earth.jpg'
|
||||
|
||||
// 卫星轨道数据处理
|
||||
const store = useStore()
|
||||
|
@ -30,7 +28,7 @@ const onDataSourceReady = ({ viewer, cesiumObject }) => {
|
|||
}
|
||||
|
||||
// 显示/隐藏、跟踪卫星等交互操作
|
||||
let vcViewerInstance = null
|
||||
let vcViewerInstance: any = null
|
||||
store.subscribeAction(({ type, payload }) => {
|
||||
// 显示/隐藏卫星
|
||||
if (type === 'satelliteSystem/toggleShow') {
|
||||
|
@ -73,6 +71,7 @@ const onViewerReady = ({ viewer }) => {
|
|||
</script>
|
||||
|
||||
<style>
|
||||
/* 隐藏动画仪表盘中的日期和时间 */
|
||||
.vc-viewer .cesium-viewer .cesium-viewer-animationContainer svg > g > g text:not(:last-of-type) {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -17,9 +17,7 @@ import { ref, watch, onMounted } from 'vue'
|
|||
|
||||
const store = useStore()
|
||||
const selected = ref('')
|
||||
watch(selected, (value) => store.dispatch('satelliteSystem/setName', {
|
||||
name: value
|
||||
}))
|
||||
watch(selected, (value) => store.dispatch('satelliteSystem/setName', { name: value }))
|
||||
onMounted(() => selected.value = Object.keys(option_dic)[0])
|
||||
|
||||
const option_dic = {
|
||||
|
|
Loading…
Reference in New Issue