diff --git a/modules/export.js b/modules/export.js index 1b8590b7..d2b63110 100644 --- a/modules/export.js +++ b/modules/export.js @@ -275,7 +275,6 @@ async function getMapURL(type, options = {}) { }); } - // TODO: add dataURL for all used fonts const usedFonts = getUsedFonts(cloneEl); const fontsToLoad = usedFonts.filter(font => font.src); if (fontsToLoad.length) { @@ -305,7 +304,6 @@ async function getMapURL(type, options = {}) { // remove hidden g elements and g elements without children to make downloaded svg smaller in size function removeUnusedElements(clone) { if (!terrain.selectAll("use").size()) clone.select("#defs-relief")?.remove(); - if (markers.style("display") === "none") clone.select("#defs-markers")?.remove(); for (let empty = 1; empty; ) { empty = 0; diff --git a/modules/load.js b/modules/load.js index 42df051d..158488c9 100644 --- a/modules/load.js +++ b/modules/load.js @@ -383,33 +383,33 @@ function parseLoadedData(data) { .forEach((el) => el.classList.add('buttonoff')); // turn on active layers - if (notHidden(texture) && hasChild(texture, 'image')) turnOn('toggleTexture'); - if (hasChildren(terrs)) turnOn('toggleHeight'); - if (hasChildren(biomes)) turnOn('toggleBiomes'); - if (hasChildren(cells)) turnOn('toggleCells'); - if (hasChildren(gridOverlay)) turnOn('toggleGrid'); - if (hasChildren(coordinates)) turnOn('toggleCoordinates'); - if (notHidden(compass) && hasChild(compass, 'use')) turnOn('toggleCompass'); - if (hasChildren(rivers)) turnOn('toggleRivers'); - if (notHidden(terrain) && hasChildren(terrain)) turnOn('toggleRelief'); - if (hasChildren(relig)) turnOn('toggleReligions'); - if (hasChildren(cults)) turnOn('toggleCultures'); - if (hasChildren(statesBody)) turnOn('toggleStates'); - if (hasChildren(provs)) turnOn('toggleProvinces'); - if (hasChildren(zones) && notHidden(zones)) turnOn('toggleZones'); - if (notHidden(borders) && hasChild(compass, 'use')) turnOn('toggleBorders'); - if (notHidden(routes) && hasChild(routes, 'path')) turnOn('toggleRoutes'); - if (hasChildren(temperature)) turnOn('toggleTemp'); - if (hasChild(population, 'line')) turnOn('togglePopulation'); - if (hasChildren(ice)) turnOn('toggleIce'); - if (hasChild(prec, 'circle')) turnOn('togglePrec'); - if (notHidden(emblems) && hasChild(emblems, 'use')) turnOn('toggleEmblems'); - if (notHidden(labels)) turnOn('toggleLabels'); - if (notHidden(icons)) turnOn('toggleIcons'); - if (hasChildren(armies) && notHidden(armies)) turnOn('toggleMilitary'); - if (hasChildren(markers) && notHidden(markers)) turnOn('toggleMarkers'); - if (notHidden(ruler)) turnOn('toggleRulers'); - if (notHidden(scaleBar)) turnOn('toggleScaleBar'); + if (notHidden(texture) && hasChild(texture, "image")) turnOn("toggleTexture"); + if (hasChildren(terrs)) turnOn("toggleHeight"); + if (hasChildren(biomes)) turnOn("toggleBiomes"); + if (hasChildren(cells)) turnOn("toggleCells"); + if (hasChildren(gridOverlay)) turnOn("toggleGrid"); + if (hasChildren(coordinates)) turnOn("toggleCoordinates"); + if (notHidden(compass) && hasChild(compass, "use")) turnOn("toggleCompass"); + if (hasChildren(rivers)) turnOn("toggleRivers"); + if (notHidden(terrain) && hasChildren(terrain)) turnOn("toggleRelief"); + if (hasChildren(relig)) turnOn("toggleReligions"); + if (hasChildren(cults)) turnOn("toggleCultures"); + if (hasChildren(statesBody)) turnOn("toggleStates"); + if (hasChildren(provs)) turnOn("toggleProvinces"); + if (hasChildren(zones) && notHidden(zones)) turnOn("toggleZones"); + if (notHidden(borders) && hasChild(compass, "use")) turnOn("toggleBorders"); + if (notHidden(routes) && hasChild(routes, "path")) turnOn("toggleRoutes"); + if (hasChildren(temperature)) turnOn("toggleTemp"); + if (hasChild(population, "line")) turnOn("togglePopulation"); + if (hasChildren(ice)) turnOn("toggleIce"); + if (hasChild(prec, "circle")) turnOn("togglePrec"); + if (notHidden(emblems) && hasChild(emblems, "use")) turnOn("toggleEmblems"); + if (notHidden(labels)) turnOn("toggleLabels"); + if (notHidden(icons)) turnOn("toggleIcons"); + if (hasChildren(armies) && notHidden(armies)) turnOn("toggleMilitary"); + if (hasChildren(markers)) turnOn("toggleMarkers"); + if (notHidden(ruler)) turnOn("toggleRulers"); + if (notHidden(scaleBar)) turnOn("toggleScaleBar"); getCurrentPreset(); })();