From 120cfc2cb36296009054a12c5a30f5a7e6b55e4d Mon Sep 17 00:00:00 2001 From: JIANG Date: Fri, 19 Dec 2025 11:55:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DMaximum=20call=20stack=20size?= =?UTF-8?q?=20exceeded=E7=9A=84=E9=94=99=E8=AF=AF=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20...=20=E6=95=B0=E7=BB=84=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E7=AC=A6=EF=BC=9B=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E5=92=8C=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/OlMap/Controls/StyleEditorPanel.tsx | 4 +++- src/app/OlMap/MapComponent.tsx | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/app/OlMap/Controls/StyleEditorPanel.tsx b/src/app/OlMap/Controls/StyleEditorPanel.tsx index 780b51e..6206083 100644 --- a/src/app/OlMap/Controls/StyleEditorPanel.tsx +++ b/src/app/OlMap/Controls/StyleEditorPanel.tsx @@ -359,7 +359,9 @@ const StyleEditorPanel: React.FC = ({ setJunctionText(property); setShowJunctionTextLayer(styleConfig.showLabels); setApplyJunctionStyle(true); - setContourLayerAvailable && setContourLayerAvailable(true); + if (property === "pressure" && setContourLayerAvailable) { + setContourLayerAvailable(true); + } saveLayerStyle(layerId); open?.({ type: "success", diff --git a/src/app/OlMap/MapComponent.tsx b/src/app/OlMap/MapComponent.tsx index be2b13d..8533931 100644 --- a/src/app/OlMap/MapComponent.tsx +++ b/src/app/OlMap/MapComponent.tsx @@ -155,7 +155,7 @@ const MapComponent: React.FC = ({ children }) => { return false; }); if (uniqueNewData.length > 0) { - setJunctionDataState((prev) => [...prev, ...uniqueNewData]); + setJunctionDataState((prev) => prev.concat(uniqueNewData)); } }; const setPipeData = (newData: any[]) => { @@ -168,7 +168,7 @@ const MapComponent: React.FC = ({ children }) => { return false; }); if (uniqueNewData.length > 0) { - setPipeDataState((prev) => [...prev, ...uniqueNewData]); + setPipeDataState((prev) => prev.concat(uniqueNewData)); } }; // 配置地图数据源、图层和样式 @@ -422,7 +422,9 @@ const MapComponent: React.FC = ({ children }) => { const uniqueData = Array.from(data.values()); if (uniqueData.length > 0) { - tileJunctionDataBuffer.current.push(...uniqueData); + uniqueData.forEach((item) => + tileJunctionDataBuffer.current.push(item) + ); debouncedUpdateData.current(); } } @@ -501,7 +503,7 @@ const MapComponent: React.FC = ({ children }) => { const uniqueData = Array.from(data.values()); if (uniqueData.length > 0) { - tilePipeDataBuffer.current.push(...uniqueData); + uniqueData.forEach((item) => tilePipeDataBuffer.current.push(item)); debouncedUpdateData.current(); } } @@ -581,7 +583,7 @@ const MapComponent: React.FC = ({ children }) => { projection: "EPSG:3857", }), // 图层依面、线、点、标注次序添加 - layers: [...availableLayers], + layers: availableLayers.slice(), controls: [], }); setMap(map); @@ -816,9 +818,7 @@ const MapComponent: React.FC = ({ children }) => { pipeText, contours, ]); - useEffect(() => { - console.log("Contour Layer Available:", isContourLayerAvailable); - }, [isContourLayerAvailable]); + // 控制流动动画开关 useEffect(() => { if (pipeText === "flow" && currentPipeCalData.length > 0) { @@ -940,7 +940,7 @@ const MapComponent: React.FC = ({ children }) => { flowFlag: pipeProperties === "flow" && record.value < 0 ? -1 : 1, path: pipeProperties === "flow" && record.value < 0 && p.flowFlag > 0 - ? [...p.path].reverse() + ? p.path.slice().reverse() : p.path, // 流量数值 [pipeProperties]: