From ef70b6089e20d7b13a6241a66e8005d93d70d769 Mon Sep 17 00:00:00 2001 From: Jonathon Leight Date: Thu, 27 Aug 2026 20:02:15 -0400 Subject: [PATCH] Migrate to vector maps --- .claude/CLAUDE.md | 3 +- .env.example | 8 +- README.md | 18 +- THIRD-PARTY-NOTICES.md | 196 ++++-- internal/config/config.go | 10 +- internal/core/templates/add_repeater.html | 5 +- .../core/templates/config_region_area.html | 15 +- internal/core/templates/console.html | 5 +- internal/core/templates/dashboard.html | 5 +- internal/core/templates/org.html | 5 +- internal/core/templates/repeater.html | 5 +- internal/e2e/basemap_test.go | 79 +++ internal/e2e/console_config_test.go | 2 +- internal/e2e/harness_test.go | 53 ++ internal/e2e/org_map_test.go | 41 +- internal/e2e/region_editor_test.go | 415 ++++++++++- internal/licenses/licenses_test.go | 2 +- internal/licenses/manifest.go | 57 +- internal/licenses/notices.go | 3 +- internal/licenses/texts/leaflet-1.9.4.txt | 26 - .../texts/leaflet-geoman-free-2.20.0.txt | 21 - .../texts/leaflet.markercluster-1.5.3.txt | 20 - .../licenses/texts/maplibre-gl-5.24.0.txt | 116 +++ internal/licenses/texts/terra-draw-1.32.3.txt | 8 + .../terra-draw-maplibre-gl-adapter-1.4.1.txt | 8 + internal/marketing/templates/privacy.html | 6 +- .../marketing/templates/repeater_public.html | 5 +- internal/web/basemap_test.go | 109 ++- internal/web/security.go | 19 +- internal/web/static/app.css | 86 ++- internal/web/static/basemap.js | 276 +++++++- internal/web/static/console-config.js | 10 +- internal/web/static/leaflet-geoman.css | 258 ------- internal/web/static/leaflet-geoman.js | 7 - internal/web/static/leaflet.css | 666 ------------------ internal/web/static/leaflet.js | 6 - internal/web/static/leaflet.markercluster.css | 81 --- internal/web/static/leaflet.markercluster.js | 6 - internal/web/static/maplibre-gl-worker.js | 10 + internal/web/static/maplibre-gl.css | 7 + internal/web/static/maplibre-gl.js | 10 + internal/web/static/meshmap.js | 144 ++-- internal/web/static/regionmap.js | 557 ++++++++++----- .../static/terra-draw-maplibre-gl-adapter.js | 7 + internal/web/static/terra-draw.js | 7 + internal/web/templates/base.html | 32 +- internal/web/templates/org_config.html | 5 +- internal/web/templates/org_public.html | 7 +- internal/web/templates/org_repeaters.html | 7 +- 49 files changed, 1866 insertions(+), 1588 deletions(-) create mode 100644 internal/e2e/basemap_test.go delete mode 100644 internal/licenses/texts/leaflet-1.9.4.txt delete mode 100644 internal/licenses/texts/leaflet-geoman-free-2.20.0.txt delete mode 100644 internal/licenses/texts/leaflet.markercluster-1.5.3.txt create mode 100644 internal/licenses/texts/maplibre-gl-5.24.0.txt create mode 100644 internal/licenses/texts/terra-draw-1.32.3.txt create mode 100644 internal/licenses/texts/terra-draw-maplibre-gl-adapter-1.4.1.txt delete mode 100644 internal/web/static/leaflet-geoman.css delete mode 100644 internal/web/static/leaflet-geoman.js delete mode 100644 internal/web/static/leaflet.css delete mode 100644 internal/web/static/leaflet.js delete mode 100644 internal/web/static/leaflet.markercluster.css delete mode 100644 internal/web/static/leaflet.markercluster.js create mode 100644 internal/web/static/maplibre-gl-worker.js create mode 100644 internal/web/static/maplibre-gl.css create mode 100644 internal/web/static/maplibre-gl.js create mode 100644 internal/web/static/terra-draw-maplibre-gl-adapter.js create mode 100644 internal/web/static/terra-draw.js diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 19b7cfe..7e770fd 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -225,7 +225,8 @@ Security is a first-class concern; we run a strict CSP and gate CI on vuln scans a ` - - - +{{template "map-styles"}} +{{template "map-scripts"}} diff --git a/internal/core/templates/config_region_area.html b/internal/core/templates/config_region_area.html index c1efe50..5c1de21 100644 --- a/internal/core/templates/config_region_area.html +++ b/internal/core/templates/config_region_area.html @@ -30,8 +30,7 @@ {{end}} - - +{{template "map-styles"}}
@@ -55,9 +54,10 @@

- Draw with the tools at the top-left of the map. A region needs an area - before it applies to anything — until then it's a draft and no repeater - picks it up. + Draw with the tools at the top-right of the map: click each corner, then + close the outline by clicking the first corner again or pressing Enter. + A region needs an area before it applies to anything — until then it's a + draft and no repeater picks it up.

{{if .Siblings}}

@@ -79,9 +79,8 @@

- - - +{{template "map-scripts"}} +{{template "map-draw-scripts"}} {{/* Values are interpolated in a JS context, so html/template JSON-encodes and escapes them — the region names and shapes are user data. */}} diff --git a/internal/core/templates/console.html b/internal/core/templates/console.html index 1077310..11c0d18 100644 --- a/internal/core/templates/console.html +++ b/internal/core/templates/console.html @@ -148,9 +148,8 @@ swap needs no new markup. The flex row is nested so the [hidden] attribute wins {{if .ShowConfig}} - - - +{{template "map-styles"}} +{{template "map-scripts"}} {{end}} diff --git a/internal/core/templates/dashboard.html b/internal/core/templates/dashboard.html index d801eae..e12d566 100644 --- a/internal/core/templates/dashboard.html +++ b/internal/core/templates/dashboard.html @@ -126,10 +126,9 @@

Repeater map

{{if .Mapped}}
- + {{template "map-styles"}}
- - + {{template "map-scripts"}} - + {{template "map-scripts"}} - + {{template "map-scripts"}} - + {{template "map-scripts"}} + +{{end}} + +{{define "map-draw-scripts"}} + + +{{end}} diff --git a/internal/web/templates/org_config.html b/internal/web/templates/org_config.html index 7fd128c..9dbe582 100644 --- a/internal/web/templates/org_config.html +++ b/internal/web/templates/org_config.html @@ -130,11 +130,10 @@
{{if .Config.HasRegionShapes}} - + {{template "map-styles"}}
- - + {{template "map-scripts"}} {{/* Region names and shapes are user data, interpolated in a JS context so html/template JSON-encodes and escapes them. */}} diff --git a/internal/web/templates/org_public.html b/internal/web/templates/org_public.html index 9ab3fbe..3957ecd 100644 --- a/internal/web/templates/org_public.html +++ b/internal/web/templates/org_public.html @@ -66,12 +66,9 @@

Repeaters

{{if .HasMap}}
- - + {{template "map-styles"}}
- - - + {{template "map-scripts"}} - - + {{template "map-scripts"}}