feat: add xy to markers geojson export

This commit is contained in:
Azgaar 2023-05-10 04:17:04 +04:00
parent 42db16e000
commit 50a9411882
3 changed files with 26 additions and 7 deletions

View file

@ -7923,7 +7923,7 @@
<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/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>
<!-- Web Components -->

View file

@ -10,7 +10,12 @@ async function saveSVG() {
link.href = url;
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");
}
@ -36,7 +41,12 @@ async function savePNG() {
window.setTimeout(function () {
canvas.remove();
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);
});
};
@ -140,7 +150,15 @@ async function saveTiles() {
// parse map svg to object url
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);
@ -315,7 +333,8 @@ async function getMapURL(type, options = {}) {
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 url = window.URL.createObjectURL(blob);
window.setTimeout(() => window.URL.revokeObjectURL(url), 5000);
@ -461,7 +480,7 @@ function saveGeoJSON_Markers() {
const coordinates = getCoordinates(x, y, 4);
const id = `marker${i}`;
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};
});

View file

@ -1,7 +1,7 @@
"use strict";
// 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;