细化隐患点显示逻辑
This commit is contained in:
@@ -24,17 +24,22 @@ export const useHiddenPoint = () => {
|
||||
|
||||
/**
|
||||
* 根据灾害类型获取对应图标
|
||||
* @param disasterType - 灾害类型
|
||||
* @param disasterType - 灾害类型(支持中英文)
|
||||
* @returns 图标路径
|
||||
*/
|
||||
function getDisasterIcon(disasterType?: string): string {
|
||||
// 支持英文和中文两种格式
|
||||
switch (disasterType) {
|
||||
case 'landslide':
|
||||
case '滑坡':
|
||||
return landslideIcon;
|
||||
case 'debris_flow':
|
||||
case '泥石流':
|
||||
return debrisFlowIcon;
|
||||
case 'water_logging':
|
||||
case '内涝':
|
||||
return waterLoggingIcon;
|
||||
case 'flash_flood':
|
||||
case '山洪':
|
||||
return flashFloodIcon;
|
||||
default:
|
||||
|
||||
@@ -4,15 +4,6 @@ import { useStatusStore } from '@/stores/useStatusStore.ts';
|
||||
* 控制面板显示隐藏逻辑
|
||||
*/
|
||||
export const useLayerControl = () => {
|
||||
/**
|
||||
* 点击显示隐藏隐患点
|
||||
* @param status - 显示隐藏状态
|
||||
*/
|
||||
const clickHiddenDangerPoint = (status: unknown) => {
|
||||
// 改变风险点显示状态
|
||||
useStatusStore().mapLayers.riskPointShow.show = status as boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击显示医院
|
||||
*/
|
||||
@@ -116,8 +107,43 @@ export const useLayerControl = () => {
|
||||
useStatusStore().poiLayers.showSubwayStation.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示滑坡隐患点
|
||||
*/
|
||||
const clickLandslideHiddenPoint = () => {
|
||||
useStatusStore().poiLayers.showLandslideHiddenPoint.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示泥石流隐患点
|
||||
*/
|
||||
const clickDebrisFlowHiddenPoint = () => {
|
||||
useStatusStore().poiLayers.showDebrisFlowHiddenPoint.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示内涝隐患点
|
||||
*/
|
||||
const clickWaterLoggingHiddenPoint = () => {
|
||||
useStatusStore().poiLayers.showWaterLoggingHiddenPoint.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示山洪隐患点
|
||||
*/
|
||||
const clickFlashFloodHiddenPoint = () => {
|
||||
useStatusStore().poiLayers.showFlashFloodHiddenPoint.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示风险点
|
||||
*/
|
||||
const clickRiskPoint = () => {
|
||||
useStatusStore().mapLayers.riskPointShow.loading = true;
|
||||
};
|
||||
|
||||
return {
|
||||
clickHiddenDangerPoint,
|
||||
clickRiskPoint,
|
||||
clickHospital,
|
||||
clickDangerousSource,
|
||||
clickEmergencyShelter,
|
||||
@@ -132,5 +158,9 @@ export const useLayerControl = () => {
|
||||
clickBridge,
|
||||
clickReservoir,
|
||||
clickSubwayStation,
|
||||
clickLandslideHiddenPoint,
|
||||
clickDebrisFlowHiddenPoint,
|
||||
clickWaterLoggingHiddenPoint,
|
||||
clickFlashFloodHiddenPoint,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user