viewport = {
const n = 10;
const p = 40;
return {
type: "Polygon",
coordinates: [
[
...Array.from({length: n}, (_, t) => [p + (width - p * 2) * t / n, p]),
...Array.from({length: n}, (_, t) => [width - p, (height - p * 2) * t / n + p]),
...Array.from({length: n}, (_, t) => [p + (width - p * 2) * (n - t) / n, height - p]),
...Array.from({length: n}, (_, t) => [p, (height - p * 2) * (n - t) / n + p]),
[p, p]
].map(p => projection.invert(p))
]
};
}