mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-09-01 16:48:26 +00:00
Carto now requires an API key for basemaps.cartocdn.com and is retiring raster tiles, so the mesh map's dark theme rendered an "API KEY REQUIRED" watermark. OSM hosts no dark tiles of its own -- its Standard layer is light only -- so switch the dark basemap to OpenFreeMap's vector 'dark' style, rendered through MapLibre GL via maplibre-gl-leaflet. Leaflet and the light OSM raster layer are unchanged, and the bridge renders into tilePane so marker and overlay z-order is untouched. Fall back to inverted OSM raster tiles when WebGL 2 or the bridge is unavailable, so a failure degrades to a filtered map rather than a blank one. The filter targets .leaflet-tile rather than .leaflet-tile-container: the container is a 0x0 element that its absolutely-positioned tiles overflow, so a filter there has an empty reference box and paints nothing. CSP: drop cartocdn, allow tiles.openfreemap.org, and permit blob: workers. MapLibre spawns its renderer in a worker from a blob: URL; without worker-src it falls back to default-src 'self' and never starts.