From 15af7879501f8b593294ab915f59cb2eb2b91674 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Mon, 9 Mar 2026 18:04:07 +0000 Subject: [PATCH] Update to using stadiamaps API --- html/static/js/geocode.js | 7 ++++--- html/template/sync/communication-root.html | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/html/static/js/geocode.js b/html/static/js/geocode.js index cd9274b3..6b276b69 100644 --- a/html/static/js/geocode.js +++ b/html/static/js/geocode.js @@ -1,5 +1,6 @@ -async function geocodeReverse(MAPBOX_ACCESS_TOKEN, lngLat) { - const url = `https://api.mapbox.com/search/geocode/v6/reverse?longitude=${lngLat.lng}&latitude=${lngLat.lat}&access_token=${MAPBOX_ACCESS_TOKEN}` +async function geocodeReverse(lngLat) { + // curl "https://api.stadiamaps.com/geocoding/v2/reverse?point.lat=59.444351&point.lon=24.750645&api_key=YOUR-API-KEY" + const url = `https://api.stadiamaps.com/geocoding/v2/reverse?point.lat=${lngLat.lat}&point.lon=${lngLat.lng}`; const response = await fetch(url); const data = await response.json(); console.log("reverse geocoded to", data); @@ -7,5 +8,5 @@ async function geocodeReverse(MAPBOX_ACCESS_TOKEN, lngLat) { console.warn("No results for reverse geocode"); return; } - return data + return data; } diff --git a/html/template/sync/communication-root.html b/html/template/sync/communication-root.html index 06d8d7f1..521be2d4 100644 --- a/html/template/sync/communication-root.html +++ b/html/template/sync/communication-root.html @@ -57,6 +57,7 @@ name: "John Smith", has_email: true, }, + tod_evening: true, }, type: "nuisance",