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