Fix rendering with tileMargin on top and bottom border of map
This commit is contained in:
parent
aba60f0c6a
commit
a5efce4c84
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue