显示隐藏断裂带bug修复
This commit is contained in:
@@ -6,7 +6,10 @@
|
||||
import { xianFaultData } from '@/assets';
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils';
|
||||
import { Color } from 'cesium';
|
||||
import { onMounted } from 'vue';
|
||||
import { onMounted, watch } from 'vue';
|
||||
import { useStatusStore } from '@/stores/useStatusStore.ts';
|
||||
|
||||
const statusStore = useStatusStore();
|
||||
|
||||
onMounted(() => {
|
||||
CesiumUtilsSingleton.addGeoJsonLayer(
|
||||
@@ -23,5 +26,19 @@
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// 监听断裂带显示/隐藏状态
|
||||
watch(
|
||||
() => statusStore.mapLayers.faultShow.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示断裂带
|
||||
CesiumUtilsSingleton.showGeoJsonLayer('xian-earthque-fault-data');
|
||||
} else {
|
||||
// 隐藏断裂带
|
||||
CesiumUtilsSingleton.hideGeoJsonLayer('xian-earthque-fault-data');
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<FaultComponent
|
||||
v-if="
|
||||
useStatusStore().appLoadingCompleted &&
|
||||
useStatusStore().mapLayers.faultShow
|
||||
useStatusStore().mapLayers.faultShow.loading
|
||||
"
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user