Published
Edited
May 10, 2022
Insert cell
Insert cell
Insert cell
L = {
const L = await require("leaflet@1/dist/leaflet.js");
if (!L._style) {
const href = await require.resolve("leaflet@1/dist/leaflet.css");
document.head.appendChild(L._style = html`<link href=${href} rel=stylesheet>`);
}
await require("leaflet.sync@0.2.4/L.Map.Sync.js").catch(() => {});
return L;
}
Insert cell
parcelData = await FileAttachment("parcel-area-details.geojson").json();
Insert cell
features = await FileAttachment("zone_to_flum@2.csv").csv({typed: true});
Insert cell
gpinToFeature = Object.fromEntries(features.map(feature => {return [feature.gpin, feature]}));
Insert cell
fullscreenButton = html`<button>Switch to fullscreen</button>`;
Insert cell
function fullscreen(cell, button) {
const test = document.body.requestFullscreen || document.body.webkitRequestFullscreen;
if (!test) {
return false;
}
if (document.body.className === "fullscreen") {
return false;
}

button.onclick = () => {
const container = cell.parentNode;
if (container.requestFullscreen) {
container.requestFullscreen();
}
else if (container.webkitRequestFullscreen) {
container.webkitRequestFullscreen();
}
};

return true;
}
Insert cell
fullscreen(map, fullscreenButton)
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