Public
Edited
May 17, 2023
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
Insert cell
{
map.on("load", () => {
map.getSource("line-source")?.setData(lineGeoJSON);
map.getSource("graticule-source")?.setData(graticuleGeoJSON);
});
}
Insert cell
{
map.getSource("line-source")?.setData(lineGeoJSON);
map.getSource("graticule-source")?.setData(graticuleGeoJSON);
}
Insert cell
Insert cell
lineGeoJSON = {
const destination = turf.destination(
hawaiiCoords,
selectedDistance,
selectedBearing,
{ units: "kilometers" }
);

return {
type: "Feature",
properties: {},
geometry: {
type: "LineString",
coordinates: [hawaiiCoords, destination.geometry.coordinates]
}
};
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
hawaiiCoords = [-157.82291, 21.29248]
Insert cell
hiroshimaCoords = [132.318122, 34.297303]
Insert cell
turf = require("@turf/turf@6")
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