From eabc000bbf23949a8391c3cc74199f4cc0580b96 Mon Sep 17 00:00:00 2001 From: Claude Opus 5 Date: Sun, 16 Aug 2026 20:03:36 +0200 Subject: [PATCH] Migrate the demo pages to MapLibre GL JS v6 (ESM) The demo map went blank on both golftiles.org and the GitHub Pages site without any commit causing it. index.html and docs/index.html loaded MapLibre from an unpinned URL, so unpkg resolved maplibre-gl to the new v6.4.0. v6 is ESM-only: it publishes maplibre-gl.mjs and no longer ships dist/maplibre-gl.js, so that script tag 404'd, the maplibregl global was never defined, and the first line of the demo script threw a ReferenceError before a map was ever constructed. MapLibre 6.0.0 was published 2026-07-22, which is when the demos silently broke. Move all three demo pages to v6 instead of pinning back to v5: import the namespace inside the existing module script, since v6 has no default export. pmtiles stays on 3.2.0 - its v3compat protocol wrapper already detects the AbortController signature and works unchanged under v6, which was verified rather than assumed. The CSS link is pinned to a major version too, since the unpinned CSS URL was the same latent hazard. demo/local-viewer.html was pinned to @5 and so was never broken, but it moves to v6 as well to keep the three demo pages on one version. Verified each page in headless Chrome over CDP: the worker loads cross-origin from the CDN via MapLibre's blob module shim, pmtiles range requests succeed, and the golf layers render with no console errors. Co-authored-by: HuggeK <48095810+HuggeK@users.noreply.github.com> --- demo/local-viewer.html | 13 +++++++++---- docs/index.html | 17 ++++++++++++----- index.html | 17 ++++++++++++----- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/demo/local-viewer.html b/demo/local-viewer.html index 2c03496..09e81ac 100644 --- a/demo/local-viewer.html +++ b/demo/local-viewer.html @@ -5,16 +5,21 @@ golfTiles PR demo - - - + +
+ + + @@ -30,7 +32,12 @@

Initial Demo using Maplibre GL JS over Sweden, finland and Denmark:

Extract from 260601. Initial position is over course: Way: Emmaboda Golfklubb (101624685)

+ + + @@ -29,7 +31,12 @@

Initial Demo using Maplibre GL JS over Sweden, finland and Denmark:

Extract from 260601. Initial position is over course: Way: Emmaboda Golfklubb (101624685)