mirror of
https://github.com/gadgethd/ukmesh.git
synced 2026-12-06 03:14:09 +00:00
At low zoom a stalled or failed vector basemap left the map as a flat background while the mesh layers kept drawing, with no error surface, no retry and no way back short of clearing site data. Basemap health: - Watchdog (8 s after style load, 10 s after a retry) detects a basemap source that never produces data, retries with a cache-busted style, then swaps to a bundled Natural Earth UK/IE outline plus DOM city labels. - Status chip reports "Reloading basemap..." or "Basemap unavailable - showing basic map" with a Retry control; mesh layers and node clicks keep working throughout. - Click handlers and onMapReady install from `style.load` instead of `load`, so a dead basemap can no longer disable interaction. - Styles without the OpenFreeMap vector source (Regions/custom styles) are left alone; a style that never loads is retried and falls back too. Caching: - Service worker splits basemap tiles (cache-first, snapshot-addressed) from style JSON/TileJSON/sprites/glyphs (network-first, 5 min TTL) and stops caching MapLibre's stable-name `.mjs` worker bundles; caches move to v9. - nginx serves /assets/*.mjs with no-cache so a new page bundle cannot pair with an old worker. - Waiting service worker activates when the tab is hidden. Labels: - UK place labels for z4.5-9.6 plus a contrast lift, restoring place names at the zoom levels where the upstream dark style is sparse. Reconciled with main's map error/remount work: the blocking "could not load" modal stays for style/worker/WebGL failures and keeps a 15 s budget, while tile/sprite/source failures are owned by the basemap chip. Fixes #175 Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>