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
+5
-2
@@ -28,8 +28,11 @@ copy("maplibre-gl-lanes/LICENSE", "maplibre-gl-lanes/LICENSE");
|
||||
copy("suncalc/index.js", "suncalc/suncalc.js");
|
||||
copy("suncalc/LICENSE", "suncalc/LICENSE");
|
||||
|
||||
// Only the flags already vendored (the European subset), not all ~270.
|
||||
for (const f of readdirSync(vendor("flag-icons/1x1"))) copy(`flag-icons/flags/1x1/${f}`, `flag-icons/1x1/${f}`);
|
||||
// Only the flags of the countries the offline region picker lists
|
||||
// (lib/maptool/data/geofabrik_regions.geojson, from bin/geofabrik-regions-sync.mjs).
|
||||
const regionCatalog = JSON.parse(readFileSync(`${root}lib/maptool/data/geofabrik_regions.geojson`, "utf8"));
|
||||
const flagCodes = new Set(regionCatalog.features.map((f) => f.properties.code.match(/^([A-Z]{2})(-|$)/)?.[1]).filter(Boolean));
|
||||
for (const code of flagCodes) copy(`flag-icons/flags/1x1/${code.toLowerCase()}.svg`, `flag-icons/1x1/${code.toLowerCase()}.svg`);
|
||||
|
||||
// Material Design Icons: only the mdi* names public/js/ actually uses (the
|
||||
// whole set is ~3 MB), as one small ES module. Using another icon is just
|
||||
|
||||
Reference in new issue
Block a user