Published
Edited
Jul 3, 2019
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
apNSA = {
let hereResult = (await fetch(`https://isoline.route.api.here.com/routing/7.2/calculateisoline.json
?app_id=${hereApp.id}
&app_code=${hereApp.code}
&mode=balanced;pedestrian;traffic:disabled
&start=geo!${ap.features[0].geometry.coordinates[1]},${ap.features[0].geometry.coordinates[0]}
&range=${Math.round(nsaSlider*1609.34)}
&rangetype=distance`).then(data =>{
return data.json()
}).then(json => {
return json
}))
return hereIsolineToGeoJSON(hereResult)
}
Insert cell
Insert cell
function hereIsolineToGeoJSON(json) {
let isolineArrays = json.response.isoline.map(components => components.component.map(shapes => shapes.shape.map(coordinateStrings => coordinateStrings.split(",").map(coordinates => parseFloat(coordinates)).slice().reverse())))
return turf.featureCollection([turf.multiPolygon(isolineArrays)])
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
L = require('leaflet@1.2.0')
Insert cell
html`<link href='${resolve('leaflet@1.2.0/dist/leaflet.css')}' rel='stylesheet' />`
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