mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 20:11:24 +01:00
Requested fixes
This commit is contained in:
parent
58ad13cbfd
commit
143e1dfbd7
2 changed files with 31 additions and 24 deletions
|
|
@ -71,7 +71,7 @@ async function saveJPEG() {
|
|||
}
|
||||
|
||||
// parse map svg to object url
|
||||
async function getMapURL(type, options=[]) {
|
||||
async function getMapURL(type, {globe=false, noLabels=false, noWater=false}) {
|
||||
const cloneEl = document.getElementById("map").cloneNode(true); // clone svg
|
||||
cloneEl.id = "fantasyMap";
|
||||
document.body.appendChild(cloneEl);
|
||||
|
|
@ -83,13 +83,13 @@ async function getMapURL(type, options=[]) {
|
|||
|
||||
const isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") > -1;
|
||||
if (isFirefox && type === "mesh") clone.select("#oceanPattern").remove();
|
||||
if (options.includes("globe")) clone.select("#scaleBar").remove();
|
||||
if (options.includes("noLabels")) {
|
||||
if (globe) clone.select("#scaleBar").remove();
|
||||
if (noLabels) {
|
||||
clone.select("#labels #states").remove();
|
||||
clone.select("#labels #burgLabels").remove();
|
||||
clone.select("#icons #burgIcons").remove();
|
||||
}
|
||||
if (options.includes("noWater")) {
|
||||
if (noWater) {
|
||||
clone.select("#oceanBase").attr("opacity", 0);
|
||||
clone.select("#oceanPattern").attr("opacity", 0);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue