map = {
const height = width * mapSize.height / mapSize.width;
const container = html`<div style="height:${height}px;">`;
yield container;
const map = L.map(container, {
zoomAnimation: false,
zoomSnap: 0,
topoMove: true,
worldCopyJump: true,
zoomAnimation: false,
fadeAnimation: false,
renderer: new L.SVG({ padding: 1 })
});
const topo = new LeafletTopology(countries, map);
const topoLayer = topo.createLayer(countries.objects.countries);
topoLayer.addTo(map);
mutable topoRef = topo;
map.setMaxBounds([[-90, -360], [90, 360]])
function fitWorld() {
const zoomY = map.getBoundsZoom(L.latLngBounds(L.latLng(-90, 0), L.latLng(90, 0)));
const zoomX = map.getBoundsZoom(L.latLngBounds(L.latLng(0, -180), L.latLng(0, 180)));
map.setMinZoom(Math.max(zoomX, zoomY));
}
fitWorld();
map.fitBounds([[-90, -360], [90, 360]]);
invalidation.then(() => map.remove());
container.map = map;
yield container;
}