Public
Edited
Mar 17, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
isochrone_data = {
const rawFetch = await fetch(
`https://api.targomo.com/westcentraleurope/v1/polygon?key=${targomoKey()}`,
{
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(config)
}
);

const geoJSON = (await rawFetch.json()).data;

map.getSource("isochrone").setData(geoJSON);

return geoJSON;
}
Insert cell
map.fitBounds(turf.bbox(isochrone_data), { padding: 20 })
Insert cell
config = {
const cfg = {
edgeWeight: "time",
maxEdgeWeight: maxTime,
sources: [
{
id: "source1",
lat: mapMarker.lat,
lng: mapMarker.lng,
tm: mode.tm
}
],
polygon: {
values: [maxTime],
serializer: "geojson",
srid: 4326,
buffer: 0.0004,
quadrantSegments: 5
}
};
return cfg;
}
Insert cell
Insert cell
modesconfig = [
{ label: "Standard Transit", tm: { transit: {} } },
{
label: "Bike + Transit",
tm: { biketransit: { allowBikesOnAllTransitRoutes: true } }
}
]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more