fix: switch server portal map tiles to CARTO (OSM was rate-limiting/blocking)

OSM tile.openstreetmap.org was returning grey tiles on the portal (likely
rate-limiting the Cloudflare tunnel egress IP). Switch to CARTO Voyager
tiles which are free, CDN-backed, and don't have the same restrictions.

Also add data-tile-subdomains attribute support in history.js so tile
provider subdomains can be configured per-deployment.

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
Mathieu Moran
2026-08-10 05:51:18 -04:00
co-authored by Copilot
parent 5e0b30759d
commit f90a5e5826
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -55,8 +55,8 @@
</div>
<div class="card-body p-0">
<div id="history-map" aria-label="Selected trip route map"
data-tile-url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
data-tile-attrib="&copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors"
data-tile-url="https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png"
data-tile-attrib="&copy; <a href='https://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors &copy; <a href='https://carto.com/attributions'>CARTO</a>"
data-min-zoom="3" data-max-zoom="19"></div>
<div id="trip-timeline" class="border-top p-3" hidden>
<div class="d-flex align-items-center gap-3">
+2
View File
@@ -13,12 +13,14 @@
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 tileSubdomains = mapEl.dataset.tileSubdomains || "abc";
const minZoom = parseInt(mapEl.dataset.minZoom, 10) || 3;
const maxZoom = parseInt(mapEl.dataset.maxZoom, 10) || 19;
const map = L.map("history-map", { minZoom: minZoom, maxZoom: maxZoom }).setView([48.505, -0.09], 12);
const tiles = L.tileLayer(tileUrl, {
minZoom: minZoom,
maxZoom: maxZoom,
subdomains: tileSubdomains,
attribution: tileAttrib,
}).addTo(map);
let routeLayer = null;