async function map({center, zoom = 20, zoomDelta = 0, visibility}) {
const projection = d3.geoMercator()
.center(center)
.scale(Math.pow(2, zoom) / (2 * Math.PI))
.translate([width / 2, height / 2]);
const path = d3.geoPath(projection);
const tile = d3.tile()
.tileSize(512)
.size([width, height])
.scale(Math.pow(2, zoom))
.translate(projection([0, 0]))
.zoomDelta(zoomDelta);
const root = svg`<svg viewBox="0 0 ${width} ${height}" style="background: white;">`;
new Promise(resolve => requestIdleCallback(resolve))
.then(visibility)
.then(() => Promise.all(tile().map(async ([x, y, z]) => {
const {roads} = await (await fetch(`https://tile.nextzen.org/tilezen/vector/v1/512/all/${z}/${x}/${y}.json?api_key=${nextzen_key}`)).json();
root.appendChild(svg`<path fill="none" stroke="#000" stroke-width="0.75" d="${path(roads)}">`);
})));
return root;
}