include gutter in offsets
This commit is contained in:
@@ -208,7 +208,11 @@ class CanvasTileLayerRenderer extends CanvasLayerRenderer {
|
|||||||
tileCoord[2] * tileSize[1])
|
tileCoord[2] * tileSize[1])
|
||||||
);
|
);
|
||||||
|
|
||||||
return this.getImageData(tile.getImage(), col, row);
|
const gutter = Math.round(
|
||||||
|
tilePixelRatio * source.getGutterForProjection(viewState.projection)
|
||||||
|
);
|
||||||
|
|
||||||
|
return this.getImageData(tile.getImage(), col + gutter, row + gutter);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -397,8 +397,19 @@ class TileTexture extends EventTarget {
|
|||||||
|
|
||||||
let data;
|
let data;
|
||||||
const image = this.tile.getImage();
|
const image = this.tile.getImage();
|
||||||
|
const gutter = Math.round(this.tilePixelRatio_ * this.gutter_);
|
||||||
try {
|
try {
|
||||||
pixelContext.drawImage(image, col, row, 1, 1, 0, 0, 1, 1);
|
pixelContext.drawImage(
|
||||||
|
image,
|
||||||
|
col + gutter,
|
||||||
|
row + gutter,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
);
|
||||||
data = pixelContext.getImageData(0, 0, 1, 1).data;
|
data = pixelContext.getImageData(0, 0, 1, 1).data;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user