Cache the weather forecast for offline fallback

Radar flyout now also shows a 3-day Open-Meteo forecast (free, no API
key) for the map's current center. Radar frames and the forecast fetch
independently — one being unreachable doesn't hide the other. The last
successful forecast is cached in localStorage and shown (with a
"cached from" note) when the live fetch fails, so there's still
something useful once actually offline.

Radar tile images themselves aren't cached — that needs a Service
Worker, left as a separate follow-up (see TODO.adoc).
This commit is contained in:
randy committed 2026-09-09 09:42:10 +02:00
1 parent 707e71caf1
commit 8d090b0774
3 files changed
+173 -18

No files matched your search

+30
View File
@@ -193,6 +193,36 @@ html, body {
white-space: nowrap;
}
.radar-control__forecast {
margin-top: 6px;
padding-top: 6px;
border-top: 1px solid #eee;
}
.radar-control__forecast-day {
display: flex;
align-items: center;
gap: 8px;
padding: 2px 0;
white-space: nowrap;
}
.radar-control__forecast-day span:first-child {
width: 2.2em;
color: #888;
}
.radar-control__forecast-day span:nth-child(3) {
margin-left: auto;
font-variant-numeric: tabular-nums;
}
.radar-control__forecast-stale {
margin: 4px 0 0;
color: #888;
font-size: 11px;
}
.basemap-panel {
position: fixed;
top: 0;