mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 09:41:24 +01:00
feat: add xy to markers geojson export
This commit is contained in:
parent
42db16e000
commit
50a9411882
3 changed files with 26 additions and 7 deletions
|
|
@ -7923,7 +7923,7 @@
|
||||||
<script defer src="modules/io/save.js"></script>
|
<script defer src="modules/io/save.js"></script>
|
||||||
<script defer src="modules/io/load.js?v=1.88.05"></script>
|
<script defer src="modules/io/load.js?v=1.88.05"></script>
|
||||||
<script defer src="modules/io/cloud.js"></script>
|
<script defer src="modules/io/cloud.js"></script>
|
||||||
<script defer src="modules/io/export.js"></script>
|
<script defer src="modules/io/export.js?v=1.89.16"></script>
|
||||||
<script defer src="modules/io/formats.js"></script>
|
<script defer src="modules/io/formats.js"></script>
|
||||||
|
|
||||||
<!-- Web Components -->
|
<!-- Web Components -->
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,12 @@ async function saveSVG() {
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.click();
|
link.click();
|
||||||
|
|
||||||
tip(`${link.download} is saved. Open "Downloads" screen (crtl + J) to check. You can set image scale in options`, true, "success", 5000);
|
tip(
|
||||||
|
`${link.download} is saved. Open "Downloads" screen (crtl + J) to check. You can set image scale in options`,
|
||||||
|
true,
|
||||||
|
"success",
|
||||||
|
5000
|
||||||
|
);
|
||||||
TIME && console.timeEnd("saveSVG");
|
TIME && console.timeEnd("saveSVG");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,7 +41,12 @@ async function savePNG() {
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
canvas.remove();
|
canvas.remove();
|
||||||
window.URL.revokeObjectURL(link.href);
|
window.URL.revokeObjectURL(link.href);
|
||||||
tip(`${link.download} is saved. Open "Downloads" screen (crtl + J) to check. You can set image scale in options`, true, "success", 5000);
|
tip(
|
||||||
|
`${link.download} is saved. Open "Downloads" screen (crtl + J) to check. You can set image scale in options`,
|
||||||
|
true,
|
||||||
|
"success",
|
||||||
|
5000
|
||||||
|
);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -140,7 +150,15 @@ async function saveTiles() {
|
||||||
|
|
||||||
// parse map svg to object url
|
// parse map svg to object url
|
||||||
async function getMapURL(type, options = {}) {
|
async function getMapURL(type, options = {}) {
|
||||||
const {debug = false, globe = false, noLabels = false, noWater = false, noScaleBar = false, noIce = false, fullMap = false} = options;
|
const {
|
||||||
|
debug = false,
|
||||||
|
globe = false,
|
||||||
|
noLabels = false,
|
||||||
|
noWater = false,
|
||||||
|
noScaleBar = false,
|
||||||
|
noIce = false,
|
||||||
|
fullMap = false
|
||||||
|
} = options;
|
||||||
|
|
||||||
if (fullMap) drawScaleBar(1);
|
if (fullMap) drawScaleBar(1);
|
||||||
|
|
||||||
|
|
@ -315,7 +333,8 @@ async function getMapURL(type, options = {}) {
|
||||||
|
|
||||||
clone.remove();
|
clone.remove();
|
||||||
|
|
||||||
const serialized = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>` + new XMLSerializer().serializeToString(cloneEl);
|
const serialized =
|
||||||
|
`<?xml version="1.0" encoding="UTF-8" standalone="no"?>` + new XMLSerializer().serializeToString(cloneEl);
|
||||||
const blob = new Blob([serialized], {type: "image/svg+xml;charset=utf-8"});
|
const blob = new Blob([serialized], {type: "image/svg+xml;charset=utf-8"});
|
||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
window.setTimeout(() => window.URL.revokeObjectURL(url), 5000);
|
window.setTimeout(() => window.URL.revokeObjectURL(url), 5000);
|
||||||
|
|
@ -461,7 +480,7 @@ function saveGeoJSON_Markers() {
|
||||||
const coordinates = getCoordinates(x, y, 4);
|
const coordinates = getCoordinates(x, y, 4);
|
||||||
const id = `marker${i}`;
|
const id = `marker${i}`;
|
||||||
const note = notes.find(note => note.id === id);
|
const note = notes.find(note => note.id === id);
|
||||||
const properties = {id, type, icon, ...note, size, fill, stroke};
|
const properties = {id, type, icon, x, y, ...note, size, fill, stroke};
|
||||||
return {type: "Feature", geometry: {type: "Point", coordinates}, properties};
|
return {type: "Feature", geometry: {type: "Point", coordinates}, properties};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// version and caching control
|
// version and caching control
|
||||||
const version = "1.89.15"; // generator version, update each time
|
const version = "1.89.16"; // generator version, update each time
|
||||||
|
|
||||||
{
|
{
|
||||||
document.title += " v" + version;
|
document.title += " v" + version;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue