refactor: simplify ice rendering logic by removing redundant clearing of old SVG

This commit is contained in:
StempunkDev 2026-01-14 21:23:14 +01:00
parent d1e40b6277
commit 3711478d59

View file

@ -450,11 +450,7 @@ async function parseLoadedData(data, mapVersion) {
if (isVisible(routes) && hasChild(routes, "path")) turnOn("toggleRoutes"); if (isVisible(routes) && hasChild(routes, "path")) turnOn("toggleRoutes");
if (hasChildren(temperature)) turnOn("toggleTemperature"); if (hasChildren(temperature)) turnOn("toggleTemperature");
if (hasChild(population, "line")) turnOn("togglePopulation"); if (hasChild(population, "line")) turnOn("togglePopulation");
if (pack.ice?.glaciers?.length || pack.ice?.icebergs?.length) { if (isVisible(ice)) turnOn("toggleIce");
ice.selectAll("*").remove(); // clear old SVG
drawIce(); // re-render ice from data
turnOn("toggleIce");
}
if (hasChild(prec, "circle")) turnOn("togglePrecipitation"); if (hasChild(prec, "circle")) turnOn("togglePrecipitation");
if (isVisible(emblems) && hasChild(emblems, "use")) turnOn("toggleEmblems"); if (isVisible(emblems) && hasChild(emblems, "use")) turnOn("toggleEmblems");
if (isVisible(labels)) turnOn("toggleLabels"); if (isVisible(labels)) turnOn("toggleLabels");