Skip to main content

Introduction


The SVG Map Editor is a browser-based tool for creating annotated, colour-coded maps of countries (or other SVG geometries) for inclusion in reports and documentation. Its core workflow: load an SVG map, click individual regions to assign them a colour and a text label, give each colour a defined meaning that drives an automatic legend, add a title, and export the finished graphic as a PNG or JPG at a chosen pixel size.

 

Key capabilities.
Area What it does
SVG ingest Upload an SVG, or load one automatically from the `files/` folder via `?file=` URL parameter or `settings.json` default
Object colouring & labelling Click any shape (or its group/class) to set an inline fill colour and per-object label text; groups spanning multiple islands/paths are treated as one unit
Legend  Each colour gets a "meaning" in the right panel; a legend card (swatch + meaning) is rendered on the graphic in a chosen corner, plus a sidebar legend; both appear in exports
Title  Configurable title text, corner placement (4 options), and size (S/M/L), rendered on the map and included in exports
Export  PNG or JPG at specified width/height (up to 16384 px), via canvas rendering with the Inter font embedded
Persistence  Download/upload a versioned JSON settings file mapping element IDs to colours/labels, enabling round-trip reuse and sharing of map configurations
View  Zoom (10–1000%) with fit-to-screen, pan via scrollbars, keyboard shortcuts

 

Technology. 

Pure HTML/CSS/JavaScript with no build step — Tailwind CSS (Play CDN) for styling and SVG.js v3 for live SVG DOM manipulation. Configuration lives in `settings.json` (title, description, default file, help link). Any static HTTP server is sufficient to run it.


Target use case.

Rapid production of specialised country maps with consistent colour legends for internal reports and client documents — replacing manual graphic work in Illustrator/Photoshop with a repeatable, JSON-driven workflow.

---