Track what was actually built, and flag when it's stale
The .pmtiles files themselves carry no record of what upstream snapshot they came from — only a local mtime. Each successful build now writes a small sidecar (offline.pmtiles.meta.json: the Protomaps build date used; terrain.pmtiles.meta.json: the Mapterhorn source names/md5sums) recording that, surfaced in the panel next to the existing size/updated line. New GET .../check-update routes compare the recorded build against the live upstream index/manifest — true/false/null, null meaning "don't know" (no local build yet, or the check itself failed) rather than a false "no". Kept separate from the plain status endpoints (which map.js's own topbar dot hits on every page load) since this one reaches an external service; only called once when the Offline data panel is actually opened. Also: flag emoji next to each country in the picker (derived from the ISO code via Unicode regional indicators, no image assets needed).
This commit is contained in:
1 parent
53c9a82af2
commit
4a3862189f
7 files changed
+261
-15
No files matched your search
@@ -127,6 +127,20 @@ matching `*/build-status` route) — only one of each kind at a time;
|
||||
starting a second while one's running gets a 409, as does starting
|
||||
either with nothing selected yet.
|
||||
|
||||
Each successful build also writes a small sidecar (`offline.pmtiles.
|
||||
meta.json` / `terrain.pmtiles.meta.json` — the Protomaps build date used,
|
||||
or the Mapterhorn source names/md5sums) recording what was actually
|
||||
built, since the `.pmtiles` file itself carries no such record. `GET
|
||||
/api/offline-tiles`/`/api/terrain-tiles` include it as `meta`, shown in
|
||||
the panel next to the existing size/updated line. `GET .../check-update`
|
||||
compares that recorded build against the live upstream index/manifest
|
||||
(without rebuilding anything) and reports `update_available: true/false/
|
||||
null` — `null` means "don't know" (no local build yet, or the upstream
|
||||
check itself failed), kept as its own route rather than folded into the
|
||||
plain status endpoints above since those are on the page-load hot path
|
||||
(the topbar's offline-status dot) and this one reaches an external
|
||||
service, only worth doing when the Offline data panel is actually open.
|
||||
|
||||
== Camper-relevant POIs (Overpass)
|
||||
|
||||
`rake overpass:pois[south,west,north,east,out.geojson]` queries
|
||||
|
||||
Reference in new issue
Block a user