Offline regions for the whole world: the region list comes from Geofabrik's index (bin/geofabrik-regions-sync.mjs → geofabrik_regions.geojson, 193 countries plus subregions like the US states), keeping the European ISO codes; the picker folds it by continent with a search box and subregions under their country, flags for all of them
This commit is contained in:
1 parent
df69886220
commit
ff5924faf1
155 files changed
+5465
-113
No files matched your search
+14
-6
@@ -160,12 +160,20 @@ build.
|
||||
|
||||
A logged-in user can also generate both files above from the app
|
||||
itself, no local tooling needed — the sidebar's "Offline data" icon
|
||||
(Offline hub group) shows a checklist of European countries
|
||||
(`lib/maptool/data/europe_countries.geojson`, Natural Earth 110m
|
||||
admin-0, public domain) plus each file's status (size, last updated).
|
||||
Ticking countries and clicking "Apply changes" saves the selection
|
||||
(`data/offline_regions.json`, an array of ISO A2 codes) and rebuilds
|
||||
both files to cover it.
|
||||
(Offline hub group) shows a checklist of the whole world's countries,
|
||||
folded by continent with a search box, a country's subregions (US
|
||||
states, German Länder, ...) folded under it — selectable one by one, so
|
||||
e.g. Utah alone doesn't mean downloading the 10+ GB United States
|
||||
extract — plus each file's status (size, last updated). The list is
|
||||
`lib/maptool/data/geofabrik_regions.geojson`, generated from Geofabrik's
|
||||
own index (`download.geofabrik.de/index-v1.json`) by
|
||||
`node bin/geofabrik-regions-sync.mjs` — rerun it to pick up Geofabrik
|
||||
changes. Ticking regions and clicking "Apply changes" saves the selection
|
||||
(`data/offline_regions.json`, an array of region codes: a country's ISO
|
||||
3166-1 alpha-2, a subregion's ISO 3166-2 or `<country>-<geofabrik id>`)
|
||||
and rebuilds both files to cover it. Picking a country *and* one of its
|
||||
subregions just downloads the overlap twice; osmium's merge de-duplicates
|
||||
it.
|
||||
|
||||
There's no standalone per-country *built* file — `offline.pmtiles`/
|
||||
`terrain.pmtiles` are always one combined extract for the *whole
|
||||
|
||||
@@ -83,9 +83,9 @@ Lipiridis), attribution required (this notice satisfies that):
|
||||
|===
|
||||
| Library | Version | Source
|
||||
|
||||
| flag-icons (just the square `1x1/` crop, only the 39 European
|
||||
countries `lib/maptool/data/europe_countries.geojson` lists — see
|
||||
`public/js/offline_data.js`)
|
||||
| flag-icons (just the square `1x1/` crop, only the countries the
|
||||
offline region picker lists — `lib/maptool/data/geofabrik_regions.geojson`,
|
||||
see `bin/vendor-sync.mjs` and `public/js/offline_data.js`)
|
||||
| `package.json`
|
||||
| https://github.com/lipis/flag-icons
|
||||
|===
|
||||
@@ -146,7 +146,11 @@ commit only triggers the sync, which then saves whatever style
|
||||
regeneration, or the manual recipe in `docs/development.adoc`) is
|
||||
built at build time, not vendored, from
|
||||
https://download.geofabrik.de[Geofabrik]'s per-country OpenStreetMap
|
||||
extracts (ODbL).
|
||||
extracts (ODbL). The region list itself,
|
||||
`lib/maptool/data/geofabrik_regions.geojson` (names, paths and boundary
|
||||
polygons), is vendored from Geofabrik's index
|
||||
(`download.geofabrik.de/index-v1.json`, OpenStreetMap-derived, ODbL) by
|
||||
`bin/geofabrik-regions-sync.mjs`.
|
||||
|
||||
`terrain.pmtiles` (same regeneration mechanism) is extracted at build
|
||||
time, not vendored, from https://mapterhorn.com[Mapterhorn] — a
|
||||
|
||||
Reference in new issue
Block a user