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
@@ -395,7 +395,8 @@ module Maptool
|
||||
# selected (data/offline_regions.json) — read-only, no login needed,
|
||||
# same tier as the plain availability checks above.
|
||||
get "/api/offline-regions" do
|
||||
json available: PmtilesBuilder.available_regions, selected: PmtilesBuilder.selected_regions(DATA_DIR)
|
||||
json continents: PmtilesBuilder.continents, available: PmtilesBuilder.available_regions,
|
||||
selected: PmtilesBuilder.selected_regions(DATA_DIR)
|
||||
end
|
||||
|
||||
# Just updates the selection — does not itself start a build, so
|
||||
@@ -601,12 +602,11 @@ module Maptool
|
||||
end
|
||||
|
||||
# Fetched client-side only for a country the viewer actually ticks in
|
||||
# the Hiking trails checklist, not on page load. :code is constrained
|
||||
# to exactly what hiking_trails_countries can ever return (two
|
||||
# uppercase letters) — otherwise this would accept an arbitrary
|
||||
# ".."-laden path segment.
|
||||
# the Hiking trails checklist, not on page load. :code must be one
|
||||
# hiking_trails_countries actually lists — otherwise this would accept
|
||||
# an arbitrary ".."-laden path segment.
|
||||
get "/tiles/hiking_trails/:code.geojson" do
|
||||
halt 404 unless params[:code].match?(/\A[A-Z]{2}\z/)
|
||||
halt 404 unless PmtilesBuilder.hiking_trails_countries(DATA_DIR).include?(params[:code])
|
||||
|
||||
path = PmtilesBuilder.hiking_trails_country_path(DATA_DIR, params[:code])
|
||||
halt 404 unless File.exist?(path)
|
||||
|
||||
Reference in new issue
Block a user