Fix rendering with tileMargin on top and bottom border of map (#571)
Co-authored-by: Frank Stolle <f.stolle@hosting-agency.de>
This commit is contained in:
parent
9af3bff4f7
commit
161ac5ff84
1 changed files with 3 additions and 1 deletions
|
@ -305,9 +305,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