Public
Edited
Nov 23, 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
Insert cell
config = {
const cfg = {
edgeWeight: "time",
maxEdgeWeight: maxTime,
sources: [
{
id: "source1",
lat: mapMarker.lat,
lng: mapMarker.lng,
tm: {
car: {}
}
}
],
polygon: {
values: [maxTime],
serializer: "geojson",
srid: 4326,
buffer: 0.0015,
quadrantSegments: 5
}
};
if (exclude && exclusionPolygon.features.length > 0) {
cfg.exclusionGeometry = {
crs: 4326,
data: exclusionPolygon
};
}
return cfg;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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