Fix reprojection of raster sources with gutter
This commit is contained in:
@@ -101,12 +101,13 @@ ol.reproj.enlargeClipPoint_ = function(centroidX, centroidY, x, y) {
|
||||
* @param {Array.<{extent: ol.Extent,
|
||||
* image: (HTMLCanvasElement|Image|HTMLVideoElement)}>} sources
|
||||
* Array of sources.
|
||||
* @param {number} gutter Gutter of the sources.
|
||||
* @param {boolean=} opt_renderEdges Render reprojection edges.
|
||||
* @return {HTMLCanvasElement} Canvas with reprojected data.
|
||||
*/
|
||||
ol.reproj.render = function(width, height, pixelRatio,
|
||||
sourceResolution, sourceExtent, targetResolution, targetExtent,
|
||||
triangulation, sources, opt_renderEdges) {
|
||||
triangulation, sources, gutter, opt_renderEdges) {
|
||||
|
||||
var context = ol.dom.createCanvasContext2D(Math.round(pixelRatio * width),
|
||||
Math.round(pixelRatio * height));
|
||||
@@ -136,9 +137,12 @@ ol.reproj.render = function(width, height, pixelRatio,
|
||||
var srcWidth = ol.extent.getWidth(src.extent);
|
||||
var srcHeight = ol.extent.getHeight(src.extent);
|
||||
|
||||
stitchContext.drawImage(src.image,
|
||||
xPos * stitchScale, yPos * stitchScale,
|
||||
srcWidth * stitchScale, srcHeight * stitchScale);
|
||||
stitchContext.drawImage(
|
||||
src.image,
|
||||
gutter, gutter,
|
||||
src.image.width - 2 * gutter, src.image.height - 2 * gutter,
|
||||
xPos * stitchScale, yPos * stitchScale,
|
||||
srcWidth * stitchScale, srcHeight * stitchScale);
|
||||
});
|
||||
|
||||
var targetTopLeft = ol.extent.getTopLeft(targetExtent);
|
||||
|
||||
Reference in New Issue
Block a user