查看属性,新增点击空白取消选择的逻辑
This commit is contained in:
@@ -196,7 +196,14 @@ const Toolbar: React.FC<ToolbarProps> = ({
|
|||||||
async (event: { coordinate: number[] }) => {
|
async (event: { coordinate: number[] }) => {
|
||||||
if (!map) return;
|
if (!map) return;
|
||||||
const feature = await mapClickSelectFeatures(event, map); // 调用导入的函数
|
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")) {
|
if (activeTools.includes("history")) {
|
||||||
// 历史查询模式:支持同类型多选
|
// 历史查询模式:支持同类型多选
|
||||||
|
|||||||
Reference in New Issue
Block a user