Files
xian_vue_new/src/component/rain-earthquake/detail-panels/TrafficRoadComponent.vue
T

41 lines
927 B
Vue
Raw Normal View History

2026-04-24 20:41:41 +08:00
<!-- 供水管网 -->
<template>
<LoadingGeoserverLayer
:id="`trafficRoad`"
:layers="`xian:xian_road`"
@provide-layers="provideLayers"
/>
</template>
<script lang="ts" setup>
import { useStatusStore } from '@/stores/useStatusStore.ts';
import type { ImageryLayer } from 'cesium';
import { onMounted, watch } from 'vue';
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
2026-05-07 12:53:25 +08:00
const useStatus = useStatusStore();
2026-04-24 20:41:41 +08:00
// 保存图层引用
let trafficRoadLayer: ImageryLayer | null = null;
onMounted(() => {
// 监听显示隐藏
watch(
2026-05-07 12:53:25 +08:00
() => useStatus.infrastructureLayers.showTrafficRoad.show,
2026-04-24 20:41:41 +08:00
(newValue: boolean) => {
trafficRoadLayer!.show = newValue;
}
);
});
/**
* 提供图层
* @param layer 图层
*/
function provideLayers(layer: ImageryLayer) {
trafficRoadLayer = layer;
}
</script>
<style scoped></style>