Fix rendering with tileMargin on top and bottom border of map

This commit is contained in:
Frank Stolle 2022-02-22 17:50:12 +01:00
parent aba60f0c6a
commit a5efce4c84

View file

@ -302,9 +302,11 @@ module.exports = {
});
if (z > 2 && tileMargin > 0) {
const [_, y] = mercator.px(params.center, z);
let yoffset = Math.max(Math.min(0, y - 128 - tileMargin), y + 128 + tileMargin - Math.pow(2, z + 8));
image.extract({
left: tileMargin * scale,
top: tileMargin * scale,
top: (tileMargin + yoffset) * scale,
width: width * scale,
height: height * scale
});