Files
TREK/client/src/sync
Maurice d39d544297 fix(offline): raster tiles a GL map fetches get a service worker cache of their own
Leaflet loads a tile as an image without CORS and the prefetch fetches it
no-cors, so map-tiles holds opaque answers. A GL map reads tiles with a
CORS fetch and cannot use one: once Leaflet had drawn an OpenTopoMap tile,
the GL tour layer failed on the same URL, and a MapLibre template would
fail the same way on every prefetched tile.

A CORS request for a raster preset's tile now goes to map-tiles-gl, which
keeps only readable answers, ahead of the Leaflet rules; images and the
no-cors prefetch stay in map-tiles. The matcher is written into the
service worker by its source text, so its host list is inline, and a test
holds it to the hosts the CSP lets a GL map fetch. OpenHikingMap and
CyclOSM stay out, their usage policies allow no offline copy.

The prefetch takes exactly one way per user: a template MapLibre draws on
such a host is fetched with CORS into map-tiles-gl, at the density the map
asks for, everything else as before. Clearing offline maps drops both
caches, and the iOS trim keeps both within its budget.
2026-11-30 16:22:52 +01:00
..
2026-06-16 22:22:45 +02:00
2026-07-05 01:13:04 +02:00
2026-07-05 01:13:04 +02:00