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

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