Public
Edited
Mar 13, 2023
1 star
Insert cell
Insert cell
Insert cell
grandCentralMap = {
let container = DOM.element("div", {
style: `width:${width}px;height:${width / 1.6}px`
});

yield container;

// Now we create a map object and add a layer to it.
let map = L.map(container);
let osmLayer = L.tileLayer(
"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}@2x.png",
{
attribution:
'&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}
).addTo(map);

let grandCentralLayer = L.geoJson(grandCentral, {
weight: 5,
color: "#432"
}).addTo(map);
map.fitBounds(grandCentralLayer.getBounds());

L.control.scale({ maxWidth: 500 }).addTo(map);
}
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