mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 02:01:22 +01:00
feat: burgs - export icons
This commit is contained in:
parent
63898d8fd8
commit
4a8ce1af0e
2 changed files with 16 additions and 6 deletions
|
|
@ -168,8 +168,9 @@ async function exportToPngTiles() {
|
|||
}
|
||||
|
||||
// parse map svg to object url
|
||||
async function getMapURL(type, options) {
|
||||
const {
|
||||
async function getMapURL(
|
||||
type,
|
||||
{
|
||||
debug = false,
|
||||
noLabels = false,
|
||||
noWater = false,
|
||||
|
|
@ -177,8 +178,8 @@ async function getMapURL(type, options) {
|
|||
noIce = false,
|
||||
noVignette = false,
|
||||
fullMap = false
|
||||
} = options || {};
|
||||
|
||||
} = {}
|
||||
) {
|
||||
const cloneEl = byId("map").cloneNode(true); // clone svg
|
||||
cloneEl.id = "fantasyMap";
|
||||
document.body.appendChild(cloneEl);
|
||||
|
|
@ -307,6 +308,15 @@ async function getMapURL(type, options) {
|
|||
if (rose) cloneDefs.appendChild(rose.cloneNode(true));
|
||||
}
|
||||
|
||||
// add burs icons
|
||||
if (cloneEl.getElementById("burgIcons")) {
|
||||
const groups = cloneEl.getElementById("burgIcons").querySelectorAll("g");
|
||||
for (const group of Array.from(groups)) {
|
||||
const icon = svgDefs.querySelector(group.dataset.icon);
|
||||
if (icon) cloneDefs.appendChild(icon.cloneNode(true));
|
||||
}
|
||||
}
|
||||
|
||||
// add port icon
|
||||
if (cloneEl.getElementById("anchors")) {
|
||||
const anchor = svgDefs.getElementById("icon-anchor");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue