Submap live preview.

This commit is contained in:
GoteGuru 2022-05-18 11:56:44 +02:00
parent 159c1aa3e3
commit 0d71f10f05
3 changed files with 137 additions and 36 deletions

View file

@ -139,7 +139,7 @@ async function saveTiles() {
// parse map svg to object url
async function getMapURL(type, options = {}) {
const {debug = false, globe = false, noLabels = false, noWater = false, fullMap = false} = options;
const {debug = false, globe = false, noLabels = false, noWater = false, noScaleBar = false, noIce = false, fullMap = false} = options;
if (fullMap) drawScaleBar(1);
@ -164,6 +164,12 @@ async function getMapURL(type, options = {}) {
clone.select("#oceanBase").attr("opacity", 0);
clone.select("#oceanPattern").attr("opacity", 0);
}
if (noScaleBar) {
clone.select("#scaleBar")?.remove()
}
if (noIce) {
clone.select("#ice")?.remove()
}
if (fullMap) {
// reset transform to show the whole map
clone.attr("width", graphWidth).attr("height", graphHeight);