Skip to content

Commit

Permalink
fix(my-account): import/export landmark
Browse files Browse the repository at this point in the history
  • Loading branch information
azarz committed Jan 15, 2025
1 parent d3d87fe commit 286e9d1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/js/my-account/my-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ class MyAccount {
imported.properties.locationName = "";
}
imported.properties.visible = true;
imported.properties.radiusRatio = 0;
imported.id = -1;
this.addLandmark(imported);
document.getElementById("myaccount-landmarks-tab").click();
Expand Down Expand Up @@ -1110,11 +1111,19 @@ ${props.text}`,
}
// For testing purposes
if (Capacitor.getPlatform() === "web") {
jsUtils.download(`${landmark.properties.title.replace(/[&/\\#,+()$~%.'":*?<>{}]/g, "_")}.geojson`, JSON.stringify(landmark));
jsUtils.download(`${landmark.properties.title.replace(/[&/\\#,+()$~%.'":*?<>{}]/g, "_")}.geojson`, JSON.stringify({
type: "Feature",
geometry: landmark.geometry,
properties: landmark.properties,
}));
}
Filesystem.writeFile({
path: `${landmark.properties.title.replace(/[&/\\#,+()$~%.'":*?<>{}]/g, "_")}.geojson`,
data: JSON.stringify(landmark),
data: JSON.stringify({
type: "Feature",
geometry: landmark.geometry,
properties: landmark.properties,
}),
directory: Directory.Documents,
encoding: Encoding.UTF8,
}).then(() => {
Expand Down

0 comments on commit 286e9d1

Please sign in to comment.