添加地铁站

This commit is contained in:
zhuangzhuang2000
2026-04-27 15:04:59 +08:00
parent a9f622f211
commit f3c33f70f0
13 changed files with 244 additions and 11 deletions
@@ -263,11 +263,9 @@ export const useEarthquakeDisasterChain = () => {
},
{
name: '显示地铁站',
statusStore: statusStore.infrastructureLayers,
statusKey: 'showSubway' as const,
callback: (status: unknown) => {
console.log('显示地铁站', status);
},
statusStore: statusStore.poiLayers,
statusKey: 'showSubwayStation' as const,
callback: layerControl.clickSubwayStation,
},
];
};
+5
View File
@@ -89,6 +89,11 @@ export const useMap = () => {
useLoadingInformationStore().reservoir.id = id;
}
// 地铁站点
else if (pickedObject.id.startsWith(config.prefix.subwayStationPointId)) {
useLoadingInformationStore().subwayStation.id = id;
}
// 其他
else {
// 重置状态
@@ -109,6 +109,13 @@ export const useLayerControl = () => {
useStatusStore().infrastructureLayers.showReservoir.loading = true;
};
/**
* 显示地铁站点
*/
const clickSubwayStation = () => {
useStatusStore().poiLayers.showSubwayStation.loading = true;
};
return {
clickHiddenDangerPoint,
clickHospital,
@@ -124,5 +131,6 @@ export const useLayerControl = () => {
clickNationRoad,
clickBridge,
clickReservoir,
clickSubwayStation,
};
};
@@ -0,0 +1,29 @@
import { subwayIcon } from '@/assets';
/**
* 地铁站点相关钩子函数
* @returns 字段映射和获取图标方法
*/
export const useSubwayStationPoint = () => {
/**
* 字段映射配置
*/
const field = {
stationName: '站点名称',
referToTheWaterAccumulationPoint: '参照积水点',
depthOfAccumulatedWater: '积水深度',
accumulatedWaterAfterAccounting: '核算后积水深度',
lon: '经度',
lat: '纬度',
};
/**
* 获取地铁站点图标
* @returns 图标路径
*/
function getDisasterIcon(): string {
return subwayIcon;
}
return { field, getDisasterIcon };
};
+3 -5
View File
@@ -286,11 +286,9 @@ export const useRainDisasterChain = () => {
},
{
name: '显示地铁站',
statusStore: statusStore.infrastructureLayers,
statusKey: 'showSubway' as const,
callback: (status: unknown) => {
console.log('显示地铁站', status);
},
statusStore: statusStore.poiLayers,
statusKey: 'showSubwayStation' as const,
callback: layerControl.clickSubwayStation,
},
];
};