viewof map = {
const container = DOM.element("div", {
style: `width:${width}px;height:${width / 1.5}px`
});
yield container;
const map = (container.value = L.map(container).setView(
[...center.geometry.coordinates].reverse(),
12.5
));
L.tileLayer(
"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}" +
(L.Browser.retina ? "@2x.png" : ".png"),
{
attribution:
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>, © <a href="https://carto.com/attributions">CARTO</a>',
subdomains: "abcd",
maxZoom: 18
}
).addTo(map);
const [minX, minY, maxX, maxY] = bbox;
map.fitBounds([
[minY, minX],
[maxY, maxX]
]);
yield container;
}