v1.5.72 - adding inkscape namespace

This commit is contained in:
Azgaar 2021-02-27 00:23:43 +03:00
parent a3d5aded28
commit fb4cf38bad
2 changed files with 14 additions and 5 deletions

View file

@ -37,7 +37,14 @@
<link rel="stylesheet" href="libs/jquery-ui.css">
</head>
<body>
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="map" width="100%" height="100%">
<svg id="map" width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape">
<defs>
<g id="filters">
<filter id="blurFilter" x="-1" y="-1" width="100" height="100">

View file

@ -120,13 +120,15 @@ async function getMapURL(type, subtype) {
}
// add displayed emblems
if (layerIsOn("toggleEmblems")) {
if (layerIsOn("toggleEmblems") && emblems.selectAll("use").size()) {
Array.from(cloneEl.getElementById("emblems").querySelectorAll("use")).forEach(el => {
const href = el.getAttribute("href");
if (!href) return;
const emblem = document.getElementById(href.slice(1)).cloneNode(true); // clone emblem
cloneDefs.append(emblem);
const emblem = document.getElementById(href.slice(1));
if (emblem) cloneDefs.append(emblem.cloneNode(true));
});
} else {
cloneDefs.querySelector("#defs-emblems").remove();
}
// add ocean pattern
@ -807,7 +809,7 @@ function parseLoadedData(data) {
if (hasChild(population, "line")) turnOn("togglePopulation");
if (hasChildren(ice)) turnOn("toggleIce");
if (hasChild(prec, "circle")) turnOn("togglePrec");
if (hasChild(emblems, "use")) turnOn("toggleEmblems");
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");