Published
Edited
Sep 3, 2022
11 forks
20 stars
Insert cell
Insert cell
viewof map = {
const target = html`<div style="height: 600px;">`;
yield target; // Give the container dimensions.
const map = target.value = new ol.Map({
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
target,
view: new ol.View({
center: ol.proj.fromLonLat([-77.41, 37.5]),
zoom: 10
})
});
invalidation.then(() => map.dispose());
return target;
}
Insert cell
ol = {
const ol = await require("ol@7.1.0/dist/ol.js").catch(() => window.ol);
if (!ol._style) ol._style = document.head.appendChild(html`<link rel=stylesheet href="${await require.resolve("ol@7.1.0/ol.css")}">`);
return ol;
}
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