Hello guys, I’m new to programming and to bubble. here i’m trying to use the OpenRouteService API in bubble within the google map’s map but i’m not sure about where to begin and how to make the calls ? if you guys could help it would be nice !
here is my code :
const body = {
locations: [
[lng, lat]
],
range: [900, 600, 300],
range_type: 'time',
attributes: ['area', 'total_pop'],
};
fetch('https://api.openrouteservice.org/v2/isochrones/foot-walking', {
method: 'POST',
headers: {
'Accept': 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8',
'Authorization': 'x',
'Content-Type': 'application/json; charset=utf-8'
},
body: JSON.stringify(body)
})
.then(response => response.json())
.then((data) => {
console.log(data);
map.data.addGeoJson(data);
})
.catch((err) => console.log(err))
});
Thanks a lot