完善地图元素查询机制

This commit is contained in:
JIANG
2025-10-31 16:30:32 +08:00
parent b332a6437d
commit 82fb3e1581
4 changed files with 254 additions and 45 deletions

View File

@@ -189,8 +189,13 @@ const AnalysisParameters: React.FC = () => {
async (event: { coordinate: number[] }) => {
if (!map) return;
const feature = await mapClickSelectFeatures(event, map);
const layer = feature?.getId()?.toString().split(".")[0];
if (!feature) return;
if (feature.getGeometry()?.getType() === "Point") {
if (
feature.getGeometry()?.getType() === "Point" ||
(layer !== "geo_pipes_mat" && layer !== "geo_pipes")
) {
// 点类型几何不处理
open?.({
type: "error",

View File

@@ -45,6 +45,10 @@ const ZonePropsPanel: React.FC<ZonePropsPanelProps> = ({
}
});
if (clickedFeature) {
const layer = clickedFeature?.getId()?.toString().split(".")[0];
if (layer !== "network_zone") {
return;
}
setHighlightedFeature(clickedFeature);
setProps(clickedFeature.getProperties());
// 更新高亮图层