From 9d12b1960cc50bfd7ca2b7beec40bea33464a88d Mon Sep 17 00:00:00 2001 From: JIANG Date: Fri, 6 Feb 2026 11:32:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dscheme=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/OlMap/Controls/Toolbar.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/OlMap/Controls/Toolbar.tsx b/src/app/OlMap/Controls/Toolbar.tsx index 793ba65..8914b20 100644 --- a/src/app/OlMap/Controls/Toolbar.tsx +++ b/src/app/OlMap/Controls/Toolbar.tsx @@ -402,7 +402,13 @@ const Toolbar: React.FC = ({ throw new Error("API request failed"); } const data = await response.json(); - setComputedProperties(data.results[0] || {}); + if (!data.result || data.result.length === 0) { + setComputedProperties({}); + } else { + setComputedProperties(data.result[0] || {}); + console.log("查询到的计算属性:", data.result[0]); + console.log(computedProperties); + } } catch (error) { console.error("Error querying computed properties:", error); setComputedProperties({});