From 3711478d59cb53ce3369be625d6304afb5afbadc Mon Sep 17 00:00:00 2001 From: StempunkDev Date: Wed, 14 Jan 2026 21:23:14 +0100 Subject: [PATCH] refactor: simplify ice rendering logic by removing redundant clearing of old SVG --- public/modules/io/load.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/public/modules/io/load.js b/public/modules/io/load.js index 5414f8dd..371547ec 100644 --- a/public/modules/io/load.js +++ b/public/modules/io/load.js @@ -450,11 +450,7 @@ async function parseLoadedData(data, mapVersion) { if (isVisible(routes) && hasChild(routes, "path")) turnOn("toggleRoutes"); if (hasChildren(temperature)) turnOn("toggleTemperature"); if (hasChild(population, "line")) turnOn("togglePopulation"); - if (pack.ice?.glaciers?.length || pack.ice?.icebergs?.length) { - ice.selectAll("*").remove(); // clear old SVG - drawIce(); // re-render ice from data - turnOn("toggleIce"); - } + if (isVisible(ice)) turnOn("toggleIce"); if (hasChild(prec, "circle")) turnOn("togglePrecipitation"); if (isVisible(emblems) && hasChild(emblems, "use")) turnOn("toggleEmblems"); if (isVisible(labels)) turnOn("toggleLabels");