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
+5 -1
View File
@@ -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,
}
);