fix(map): allow selecting features under overlays
This commit is contained in:
@@ -154,6 +154,7 @@ const DetectionResults: React.FC<Props> = ({
|
||||
properties: {
|
||||
name: "爆管侦测高亮",
|
||||
value: "burst_detection_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@ const LocationResults: React.FC<Props> = ({ result }) => {
|
||||
properties: {
|
||||
name: "爆管定位高亮",
|
||||
value: "burst_location_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
@@ -118,6 +118,7 @@ const SchemeQuery: React.FC<Props> = ({
|
||||
properties: {
|
||||
name: "爆管定位模拟管段高亮",
|
||||
value: "burst_location_simulation_pipe_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
map.addLayer(layer);
|
||||
|
||||
@@ -198,6 +198,7 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
|
||||
properties: {
|
||||
name: "高亮管道",
|
||||
value: "highlight_pipeline",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -140,6 +140,7 @@ const LocationResults: React.FC<LocationResultsProps> = ({
|
||||
properties: {
|
||||
name: "爆管管段高亮",
|
||||
value: "burst_pipe_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -391,6 +391,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
properties: {
|
||||
name: "爆管管段高亮",
|
||||
value: "burst_pipe_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -546,6 +546,7 @@ const ValveIsolation: React.FC<ValveIsolationProps> = ({
|
||||
properties: {
|
||||
name: "阀门节点高亮",
|
||||
value: "valve_node_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -158,6 +158,7 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
|
||||
properties: {
|
||||
name: "污染源节点",
|
||||
value: "contaminant_source_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -166,6 +166,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
properties: {
|
||||
name: "污染源高亮",
|
||||
value: "contaminant_source_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -185,6 +185,7 @@ const AnalysisParameters: React.FC<AnalysisParametersProps> = ({
|
||||
zIndex: 1000,
|
||||
properties: {
|
||||
name: "FlushingHighlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
zIndex: 1000,
|
||||
properties: {
|
||||
name: "FlushingQueryResultHighlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -143,6 +143,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
properties: {
|
||||
name: "传感器高亮",
|
||||
value: "sensor_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -708,6 +708,7 @@ const SCADADeviceList: React.FC<SCADADeviceListProps> = ({
|
||||
properties: {
|
||||
name: "SCADA 选中高亮",
|
||||
value: "scada_selected_highlight",
|
||||
queryable: false,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -189,6 +189,7 @@ const Toolbar: React.FC<ToolbarProps> = ({
|
||||
properties: {
|
||||
name: "属性查询高亮图层", // 设置图层名称
|
||||
value: "info_highlight_layer",
|
||||
queryable: false,
|
||||
type: "multigeometry",
|
||||
properties: [],
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user