查看属性,新增点击空白取消选择的逻辑

This commit is contained in:
JIANG
2025-12-31 09:36:23 +08:00
parent 2d7fcc5e3a
commit 4e24319dbb

View File

@@ -196,7 +196,14 @@ const Toolbar: React.FC<ToolbarProps> = ({
async (event: { coordinate: number[] }) => {
if (!map) return;
const feature = await mapClickSelectFeatures(event, map); // 调用导入的函数
if (!feature || !(feature instanceof Feature)) return;
if (!feature || !(feature instanceof Feature)) {
// 如果没有点击到要素,且当前是 info 模式,则清除高亮
if (activeTools.includes("info")) {
setHighlightFeatures([]);
}
return;
}
if (activeTools.includes("history")) {
// 历史查询模式:支持同类型多选