添加了交通道路、高速、国道
This commit is contained in:
@@ -70,6 +70,20 @@
|
||||
useStatusStore().infrastructureLayers.showTrafficRoad.loading
|
||||
"
|
||||
/>
|
||||
<!-- 高速 -->
|
||||
<HighwayComponent
|
||||
v-if="
|
||||
useStatusStore().appLoadingCompleted &&
|
||||
useStatusStore().infrastructureLayers.showHighway.loading
|
||||
"
|
||||
/>
|
||||
<!-- 国道 -->
|
||||
<NationRoadComponent
|
||||
v-if="
|
||||
useStatusStore().appLoadingCompleted &&
|
||||
useStatusStore().infrastructureLayers.showMainRoad.loading
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
@@ -83,6 +97,8 @@
|
||||
import WaterPipeComponent from './detail-panels/WaterPipeComponent.vue';
|
||||
import SchoolComponent from './detail-panels/SchoolComponent.vue';
|
||||
import TrafficRoadComponent from '@/component/rain-earthquake/detail-panels/TrafficRoadComponent.vue';
|
||||
import HighwayComponent from '@/component/rain-earthquake/detail-panels/HighwayComponent.vue';
|
||||
import NationRoadComponent from '@/component/rain-earthquake/detail-panels/NationRoadComponent.vue';
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<!-- 供水管网 -->
|
||||
<template>
|
||||
<LoadingGeoserverLayer
|
||||
:id="`highway`"
|
||||
:layers="`xian:xian_highway`"
|
||||
@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';
|
||||
|
||||
// 保存图层引用
|
||||
let highwayLayer: ImageryLayer | null = null;
|
||||
|
||||
onMounted(() => {
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatusStore().infrastructureLayers.showHighway.show,
|
||||
(newValue: boolean) => {
|
||||
highwayLayer!.show = newValue;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* 提供图层
|
||||
* @param layer 图层
|
||||
*/
|
||||
function provideLayers(layer: ImageryLayer) {
|
||||
highwayLayer = layer;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,38 @@
|
||||
<!-- 供水管网 -->
|
||||
<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';
|
||||
|
||||
// 保存图层引用
|
||||
let mainRoadLayer: ImageryLayer | null = null;
|
||||
|
||||
onMounted(() => {
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatusStore().infrastructureLayers.showMainRoad.show,
|
||||
(newValue: boolean) => {
|
||||
mainRoadLayer!.show = newValue;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* 提供图层
|
||||
* @param layer 图层
|
||||
*/
|
||||
function provideLayers(layer: ImageryLayer) {
|
||||
mainRoadLayer = layer;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -249,17 +249,13 @@ export const useEarthquakeDisasterChain = () => {
|
||||
name: '显示高速',
|
||||
statusStore: statusStore.infrastructureLayers,
|
||||
statusKey: 'showHighway' as const,
|
||||
callback: (status: unknown) => {
|
||||
console.log('显示高速', status);
|
||||
},
|
||||
callback: layerControl.clickHighway,
|
||||
},
|
||||
{
|
||||
name: '显示国道',
|
||||
statusStore: statusStore.infrastructureLayers,
|
||||
statusKey: 'showMainRoad' as const,
|
||||
callback: (status: unknown) => {
|
||||
console.log('显示国道', status);
|
||||
},
|
||||
callback: layerControl.clickNationRoad,
|
||||
},
|
||||
{
|
||||
name: '显示水库',
|
||||
|
||||
@@ -83,6 +83,20 @@ export const useLayerControl = () => {
|
||||
useStatusStore().infrastructureLayers.showTrafficRoad.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示高速
|
||||
*/
|
||||
const clickHighway = () => {
|
||||
useStatusStore().infrastructureLayers.showHighway.loading = true;
|
||||
};
|
||||
/**
|
||||
* 显示国道
|
||||
*/
|
||||
const clickNationRoad = () => {
|
||||
useStatusStore().infrastructureLayers.showMainRoad.loading = true;
|
||||
};
|
||||
|
||||
|
||||
return {
|
||||
clickHiddenDangerPoint,
|
||||
clickHospital,
|
||||
@@ -93,6 +107,8 @@ export const useLayerControl = () => {
|
||||
clickSchool,
|
||||
clickPopulationGrid,
|
||||
clickWaterPipe,
|
||||
clickTrafficRoad
|
||||
clickTrafficRoad,
|
||||
clickHighway,
|
||||
clickNationRoad
|
||||
};
|
||||
};
|
||||
|
||||
@@ -272,17 +272,13 @@ export const useRainDisasterChain = () => {
|
||||
name: '显示高速',
|
||||
statusStore: statusStore.infrastructureLayers,
|
||||
statusKey: 'showHighway' as const,
|
||||
callback: (status: unknown) => {
|
||||
console.log('显示高速', status);
|
||||
},
|
||||
callback: layerControl.clickHighway,
|
||||
},
|
||||
{
|
||||
name: '显示国道',
|
||||
statusStore: statusStore.infrastructureLayers,
|
||||
statusKey: 'showMainRoad' as const,
|
||||
callback: (status: unknown) => {
|
||||
console.log('显示国道', status);
|
||||
},
|
||||
callback: layerControl.clickNationRoad,
|
||||
},
|
||||
{
|
||||
name: '显示水库',
|
||||
|
||||
Reference in New Issue
Block a user