{
const container = yield htl.html`<div style="height: 600px">`;
const map = L.map(container, {
zoomControl: false,
dragging: false,
scrollWheelZoom: false,
doubleClickZoom: false,
boxZoom: false,
keyboard: false,
touchZoom: false
});
const legend = L.control({ position: "bottomright" });
legend.onAdd = function () {
const div = L.DomUtil.create("div", "info legend");
const classColors = {
"residential": "#1f77b4",
"commercial": "#ff7f0e",
"industrial": "#2ca02c",
"civic": "#d62728",
"other": "#9467bd",
}
Object.keys(classColors).forEach(cls => {
div.innerHTML += `
<i style="background: ${classColors[cls]}; opacity: 0.63; width: 18px; height: 18px; display: inline-block; margin-right: 8px;"></i>
${cls}<br>
`;
});
return div;
};
legend.addTo(map);
const layer = L.geoJSON(overture, {
style: style_buildings,
interactive: false
}).addTo(map);
map.setView([41.404, 2.170], 16.0);
L.tileLayer("https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png", {
attribution: "© <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors"
}).addTo(map);
}