Skip to content

Commit cb59231

Browse files
committed
feat: add SVG layer export bookmarklet with all-visible composite
Add export-svg-layers.js that extracts geographic/natural SVG layers (landmass, coastline, lakes, ocean, ice, rivers, terrain) as standalone SVGs with inlined styles, plus with-landmass background variants and a combined all-visible-layers SVG. Output is a zip file via JSZip.
1 parent bd7be32 commit cb59231

4 files changed

Lines changed: 714 additions & 4 deletions

File tree

tools/geojson-exports/export-all.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@
181181
.filter(function (m) { return m && !m.removed && m.x != null && m.y != null; })
182182
.map(function (m) {
183183
var props = { id: m.i, icon: m.icon || "", type: m.type || "" };
184-
if (window.notes) {
185-
var note = window.notes.find(function (n) { return n.id === "marker" + m.i; });
184+
var notesArray = typeof notes !== "undefined" && Array.isArray(notes) ? notes : [];
185+
if (notesArray.length) {
186+
var note = notesArray.find(function (n) { return n.id === "marker" + m.i; });
186187
if (note) { props.name = note.name || ""; props.legend = note.legend || ""; }
187188
}
188189
return {

tools/geojson-exports/export-markers.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@
4242
});
4343

4444
// Also include notes for markers if available
45-
if (window.notes) {
45+
var notesArray = typeof notes !== "undefined" && Array.isArray(notes) ? notes : [];
46+
if (notesArray.length) {
4647
features.forEach(function (f) {
47-
var note = window.notes.find(function (n) {
48+
var note = notesArray.find(function (n) {
4849
return n.id === "marker" + f.properties.id;
4950
});
5051
if (note) {

0 commit comments

Comments
 (0)