mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
Submap live preview.
This commit is contained in:
parent
159c1aa3e3
commit
0d71f10f05
3 changed files with 137 additions and 36 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue