From acf13639efcdcebac0abf215efe1567942ff151e Mon Sep 17 00:00:00 2001 From: Huarch Date: Fri, 17 Jul 2026 10:21:16 +0800 Subject: [PATCH] fix(map): allow selecting features under overlays --- src/components/olmap/BurstDetection/DetectionResults.tsx | 1 + src/components/olmap/BurstLocation/LocationResults.tsx | 1 + src/components/olmap/BurstLocation/SchemeQuery.tsx | 1 + src/components/olmap/BurstSimulation/AnalysisParameters.tsx | 1 + src/components/olmap/BurstSimulation/LocationResults.tsx | 1 + src/components/olmap/BurstSimulation/SchemeQuery.tsx | 1 + src/components/olmap/BurstSimulation/ValveIsolation.tsx | 1 + .../olmap/ContaminantSimulation/AnalysisParameters.tsx | 1 + src/components/olmap/ContaminantSimulation/SchemeQuery.tsx | 1 + .../olmap/FlushingAnalysis/AnalysisParameters.tsx | 1 + src/components/olmap/FlushingAnalysis/SchemeQuery.tsx | 1 + .../olmap/MonitoringPlaceOptimization/SchemeQuery.tsx | 1 + src/components/olmap/SCADA/SCADADeviceList.tsx | 1 + src/components/olmap/core/Controls/Toolbar.tsx | 1 + src/utils/mapQueryService.ts | 6 +++++- 15 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/olmap/BurstDetection/DetectionResults.tsx b/src/components/olmap/BurstDetection/DetectionResults.tsx index 8102aaa..af2a583 100644 --- a/src/components/olmap/BurstDetection/DetectionResults.tsx +++ b/src/components/olmap/BurstDetection/DetectionResults.tsx @@ -154,6 +154,7 @@ const DetectionResults: React.FC = ({ properties: { name: "爆管侦测高亮", value: "burst_detection_highlight", + queryable: false, }, }); diff --git a/src/components/olmap/BurstLocation/LocationResults.tsx b/src/components/olmap/BurstLocation/LocationResults.tsx index a697b4d..6bf7a8a 100644 --- a/src/components/olmap/BurstLocation/LocationResults.tsx +++ b/src/components/olmap/BurstLocation/LocationResults.tsx @@ -184,6 +184,7 @@ const LocationResults: React.FC = ({ result }) => { properties: { name: "爆管定位高亮", value: "burst_location_highlight", + queryable: false, }, }); map.addLayer(layer); diff --git a/src/components/olmap/BurstLocation/SchemeQuery.tsx b/src/components/olmap/BurstLocation/SchemeQuery.tsx index c64cd58..ef0cd8b 100644 --- a/src/components/olmap/BurstLocation/SchemeQuery.tsx +++ b/src/components/olmap/BurstLocation/SchemeQuery.tsx @@ -118,6 +118,7 @@ const SchemeQuery: React.FC = ({ properties: { name: "爆管定位模拟管段高亮", value: "burst_location_simulation_pipe_highlight", + queryable: false, }, }); map.addLayer(layer); diff --git a/src/components/olmap/BurstSimulation/AnalysisParameters.tsx b/src/components/olmap/BurstSimulation/AnalysisParameters.tsx index 419d66e..4a3d3f5 100644 --- a/src/components/olmap/BurstSimulation/AnalysisParameters.tsx +++ b/src/components/olmap/BurstSimulation/AnalysisParameters.tsx @@ -198,6 +198,7 @@ const AnalysisParameters: React.FC = ({ properties: { name: "高亮管道", value: "highlight_pipeline", + queryable: false, }, }); diff --git a/src/components/olmap/BurstSimulation/LocationResults.tsx b/src/components/olmap/BurstSimulation/LocationResults.tsx index d5b3503..9f14001 100644 --- a/src/components/olmap/BurstSimulation/LocationResults.tsx +++ b/src/components/olmap/BurstSimulation/LocationResults.tsx @@ -140,6 +140,7 @@ const LocationResults: React.FC = ({ properties: { name: "爆管管段高亮", value: "burst_pipe_highlight", + queryable: false, }, }); diff --git a/src/components/olmap/BurstSimulation/SchemeQuery.tsx b/src/components/olmap/BurstSimulation/SchemeQuery.tsx index 67082b0..7d6dad8 100644 --- a/src/components/olmap/BurstSimulation/SchemeQuery.tsx +++ b/src/components/olmap/BurstSimulation/SchemeQuery.tsx @@ -391,6 +391,7 @@ const SchemeQuery: React.FC = ({ properties: { name: "爆管管段高亮", value: "burst_pipe_highlight", + queryable: false, }, }); diff --git a/src/components/olmap/BurstSimulation/ValveIsolation.tsx b/src/components/olmap/BurstSimulation/ValveIsolation.tsx index 11ddd97..93f80d0 100644 --- a/src/components/olmap/BurstSimulation/ValveIsolation.tsx +++ b/src/components/olmap/BurstSimulation/ValveIsolation.tsx @@ -546,6 +546,7 @@ const ValveIsolation: React.FC = ({ properties: { name: "阀门节点高亮", value: "valve_node_highlight", + queryable: false, }, }); diff --git a/src/components/olmap/ContaminantSimulation/AnalysisParameters.tsx b/src/components/olmap/ContaminantSimulation/AnalysisParameters.tsx index a7f340f..7d03461 100644 --- a/src/components/olmap/ContaminantSimulation/AnalysisParameters.tsx +++ b/src/components/olmap/ContaminantSimulation/AnalysisParameters.tsx @@ -158,6 +158,7 @@ const AnalysisParameters: React.FC = ({ properties: { name: "污染源节点", value: "contaminant_source_highlight", + queryable: false, }, }); diff --git a/src/components/olmap/ContaminantSimulation/SchemeQuery.tsx b/src/components/olmap/ContaminantSimulation/SchemeQuery.tsx index 4797660..92f83bd 100644 --- a/src/components/olmap/ContaminantSimulation/SchemeQuery.tsx +++ b/src/components/olmap/ContaminantSimulation/SchemeQuery.tsx @@ -166,6 +166,7 @@ const SchemeQuery: React.FC = ({ properties: { name: "污染源高亮", value: "contaminant_source_highlight", + queryable: false, }, }); diff --git a/src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx b/src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx index 67848e4..8fdad66 100644 --- a/src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx +++ b/src/components/olmap/FlushingAnalysis/AnalysisParameters.tsx @@ -185,6 +185,7 @@ const AnalysisParameters: React.FC = ({ zIndex: 1000, properties: { name: "FlushingHighlight", + queryable: false, }, }); diff --git a/src/components/olmap/FlushingAnalysis/SchemeQuery.tsx b/src/components/olmap/FlushingAnalysis/SchemeQuery.tsx index 256b5b3..b6ae215 100644 --- a/src/components/olmap/FlushingAnalysis/SchemeQuery.tsx +++ b/src/components/olmap/FlushingAnalysis/SchemeQuery.tsx @@ -179,6 +179,7 @@ const SchemeQuery: React.FC = ({ zIndex: 1000, properties: { name: "FlushingQueryResultHighlight", + queryable: false, }, }); diff --git a/src/components/olmap/MonitoringPlaceOptimization/SchemeQuery.tsx b/src/components/olmap/MonitoringPlaceOptimization/SchemeQuery.tsx index cec0973..4cee79d 100644 --- a/src/components/olmap/MonitoringPlaceOptimization/SchemeQuery.tsx +++ b/src/components/olmap/MonitoringPlaceOptimization/SchemeQuery.tsx @@ -143,6 +143,7 @@ const SchemeQuery: React.FC = ({ properties: { name: "传感器高亮", value: "sensor_highlight", + queryable: false, }, }); diff --git a/src/components/olmap/SCADA/SCADADeviceList.tsx b/src/components/olmap/SCADA/SCADADeviceList.tsx index f93e2d4..4952435 100644 --- a/src/components/olmap/SCADA/SCADADeviceList.tsx +++ b/src/components/olmap/SCADA/SCADADeviceList.tsx @@ -708,6 +708,7 @@ const SCADADeviceList: React.FC = ({ properties: { name: "SCADA 选中高亮", value: "scada_selected_highlight", + queryable: false, }, }); diff --git a/src/components/olmap/core/Controls/Toolbar.tsx b/src/components/olmap/core/Controls/Toolbar.tsx index f6e6387..2596ca1 100644 --- a/src/components/olmap/core/Controls/Toolbar.tsx +++ b/src/components/olmap/core/Controls/Toolbar.tsx @@ -189,6 +189,7 @@ const Toolbar: React.FC = ({ properties: { name: "属性查询高亮图层", // 设置图层名称 value: "info_highlight_layer", + queryable: false, type: "multigeometry", properties: [], }, diff --git a/src/utils/mapQueryService.ts b/src/utils/mapQueryService.ts index 7822b5e..86e3aad 100644 --- a/src/utils/mapQueryService.ts +++ b/src/utils/mapQueryService.ts @@ -58,6 +58,10 @@ const MAP_CONFIG = { bufferUnits: "meters" as const, } as const; +const isQueryableVectorLayer = (layer: unknown): layer is VectorLayer => { + return layer instanceof VectorLayer && layer.get("queryable") !== false; +}; + // ========== 辅助函数 ========== /** @@ -413,7 +417,7 @@ const handleMapClickSelectFeatures = async ( }, { hitTolerance: MAP_CONFIG.hitTolerance, - layerFilter: (layer) => layer instanceof VectorLayer, + layerFilter: isQueryableVectorLayer, } );