Public
Edited
Jan 30, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
theDM = {
let origs = "";
let dests = "";
geocodedAddresses.forEach((a) => {
origs += `${a.items[0].position.lat},${a.items[0].position.lng}|`;
dests += `${a.items[0].position.lat},${a.items[0].position.lng}|`;
});
origs = origs.substring(0, origs.length - 1);
dests = dests.substring(0, dests.length - 1);

let response = await fetch(
`${dmURL}?key=${apiKey}&origins=${origs}&destinations=${dests}&mode=4w`
).then((dmResp) => dmResp.json());
return response;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
geocodeURL = "https://api.nextbillion.io/h/geocode"
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more