2026-04-25 21:05:59 +08:00
|
|
|
<!-- 供水管网 -->
|
|
|
|
|
<template>
|
|
|
|
|
<LoadingGeoserverLayer
|
|
|
|
|
:id="`nationalRoad`"
|
|
|
|
|
:layers="`xian:xian_national_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-25 21:05:59 +08:00
|
|
|
// 保存图层引用
|
|
|
|
|
let mainRoadLayer: ImageryLayer | null = null;
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
// 监听显示隐藏
|
|
|
|
|
watch(
|
2026-05-07 12:53:25 +08:00
|
|
|
() => useStatus.infrastructureLayers.showMainRoad.show,
|
2026-04-25 21:05:59 +08:00
|
|
|
(newValue: boolean) => {
|
|
|
|
|
mainRoadLayer!.show = newValue;
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 提供图层
|
|
|
|
|
* @param layer 图层
|
|
|
|
|
*/
|
|
|
|
|
function provideLayers(layer: ImageryLayer) {
|
|
|
|
|
mainRoadLayer = layer;
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|