Hiking trails: the main checkbox loads the countries in view from zoom 10 (and those panned into), not all at once — together ~1 GB of GeoJSON the browser never finished; /api/hiking-trails also sends each country's bbox

This commit is contained in:
randy committed 2026-11-27 14:29:29 +01:00
1 parent 477f68f5b3
commit f0ff5f390f
5 files changed
+52 -20

No files matched your search

+8
View File
@@ -186,6 +186,14 @@ module Maptool
end
private_class_method :region_bbox
# [west, south, east, north] of one region, nil for an unknown code.
def self.country_bbox(code)
south, west, north, east = region_bbox([code])
[west, south, east, north]
rescue BuildError
nil
end
def self.ring_coordinates(geometry)
case geometry["type"]
when "Polygon" then geometry["coordinates"].flatten(1)