Update to using stadiamaps API

This commit is contained in:
Eli Ribble 2026-03-09 18:04:07 +00:00
parent e932c2c473
commit 15af787950
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View file

@ -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;
}