fix: map zoom limits configurable per-deployment via data attributes

Pi offline tiles only cover zoom 8-15; OSM live tiles support 0-19.
history.js now reads data-min-zoom/data-max-zoom from the #history-map div
instead of hardcoding 3/19. Pi template caps to 8-15 (prevents blank tiles
at extreme zooms), server template allows full 3-19 OSM range.

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-10 05:42:04 -04:00
co-authored by Copilot
parent 264d38a6dc
commit c287ab67a3
3 changed files with 9 additions and 5 deletions
+5 -3
View File
@@ -13,10 +13,12 @@
const mapEl = document.getElementById("history-map");
const tileUrl = mapEl.dataset.tileUrl || "/static/vendor/tiles/{z}/{x}/{y}.png";
const tileAttrib = mapEl.dataset.tileAttrib || "&copy; MapTiler &copy; OpenStreetMap contributors";
const map = L.map("history-map", { minZoom: 3, maxZoom: 19 }).setView([48.505, -0.09], 12);
const minZoom = parseInt(mapEl.dataset.minZoom || "3", 10);
const maxZoom = parseInt(mapEl.dataset.maxZoom || "19", 10);
const map = L.map("history-map", { minZoom, maxZoom }).setView([48.505, -0.09], 12);
const tiles = L.tileLayer(tileUrl, {
minZoom: 3,
maxZoom: 19,
minZoom,
maxZoom,
attribution: tileAttrib,
});
let routeLayer = null;