fix(map): allow selecting features under overlays

This commit is contained in:
2026-07-17 10:21:16 +08:00
parent d986e563a6
commit acf13639ef
15 changed files with 19 additions and 1 deletions
@@ -154,6 +154,7 @@ const DetectionResults: React.FC<Props> = ({
properties: { properties: {
name: "爆管侦测高亮", name: "爆管侦测高亮",
value: "burst_detection_highlight", value: "burst_detection_highlight",
queryable: false,
}, },
}); });
@@ -184,6 +184,7 @@ const LocationResults: React.FC<Props> = ({ result }) => {
properties: { properties: {
name: "爆管定位高亮", name: "爆管定位高亮",
value: "burst_location_highlight", value: "burst_location_highlight",
queryable: false,
}, },
}); });
map.addLayer(layer); map.addLayer(layer);
@@ -118,6 +118,7 @@ const SchemeQuery: React.FC<Props> = ({
properties: { properties: {
name: "爆管定位模拟管段高亮", name: "爆管定位模拟管段高亮",
value: "burst_location_simulation_pipe_highlight", value: "burst_location_simulation_pipe_highlight",
queryable: false,
}, },
}); });
map.addLayer(layer); map.addLayer(layer);
@@ -198,6 +198,7 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
properties: { properties: {
name: "高亮管道", name: "高亮管道",
value: "highlight_pipeline", value: "highlight_pipeline",
queryable: false,
}, },
}); });
@@ -140,6 +140,7 @@ const LocationResults: React.FC<LocationResultsProps> = ({
properties: { properties: {
name: "爆管管段高亮", name: "爆管管段高亮",
value: "burst_pipe_highlight", value: "burst_pipe_highlight",
queryable: false,
}, },
}); });
@@ -391,6 +391,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
properties: { properties: {
name: "爆管管段高亮", name: "爆管管段高亮",
value: "burst_pipe_highlight", value: "burst_pipe_highlight",
queryable: false,
}, },
}); });
@@ -546,6 +546,7 @@ const ValveIsolation: React.FC<ValveIsolationProps> = ({
properties: { properties: {
name: "阀门节点高亮", name: "阀门节点高亮",
value: "valve_node_highlight", value: "valve_node_highlight",
queryable: false,
}, },
}); });
@@ -158,6 +158,7 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
properties: { properties: {
name: "污染源节点", name: "污染源节点",
value: "contaminant_source_highlight", value: "contaminant_source_highlight",
queryable: false,
}, },
}); });
@@ -166,6 +166,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
properties: { properties: {
name: "污染源高亮", name: "污染源高亮",
value: "contaminant_source_highlight", value: "contaminant_source_highlight",
queryable: false,
}, },
}); });
@@ -185,6 +185,7 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
zIndex: 1000, zIndex: 1000,
properties: { properties: {
name: "FlushingHighlight", name: "FlushingHighlight",
queryable: false,
}, },
}); });
@@ -179,6 +179,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
zIndex: 1000, zIndex: 1000,
properties: { properties: {
name: "FlushingQueryResultHighlight", name: "FlushingQueryResultHighlight",
queryable: false,
}, },
}); });
@@ -143,6 +143,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
properties: { properties: {
name: "传感器高亮", name: "传感器高亮",
value: "sensor_highlight", value: "sensor_highlight",
queryable: false,
}, },
}); });
@@ -708,6 +708,7 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
properties: { properties: {
name: "SCADA 选中高亮", name: "SCADA 选中高亮",
value: "scada_selected_highlight", value: "scada_selected_highlight",
queryable: false,
}, },
}); });
@@ -189,6 +189,7 @@ const Toolbar: React.FC<ToolbarProps> = ({
properties: { properties: {
name: "属性查询高亮图层", // 设置图层名称 name: "属性查询高亮图层", // 设置图层名称
value: "info_highlight_layer", value: "info_highlight_layer",
queryable: false,
type: "multigeometry", type: "multigeometry",
properties: [], properties: [],
}, },
+5 -1
View File
@@ -58,6 +58,10 @@ const MAP_CONFIG = {
bufferUnits: "meters" as const, bufferUnits: "meters" as const,
} 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, hitTolerance: MAP_CONFIG.hitTolerance,
layerFilter: (layer) => layer instanceof VectorLayer, layerFilter: isQueryableVectorLayer,
} }
); );