Fix reprojection of raster sources with gutter
This commit is contained in:
@@ -120,6 +120,29 @@ ol.source.TileImage.prototype.expireCache = function(projection, usedTiles) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.TileImage.prototype.getGutter = function(projection) {
|
||||
if (ol.ENABLE_RASTER_REPROJECTION &&
|
||||
this.getProjection() && projection &&
|
||||
!ol.proj.equivalent(this.getProjection(), projection)) {
|
||||
return 0;
|
||||
} else {
|
||||
return this.getGutterInternal();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @return {number} Gutter.
|
||||
*/
|
||||
ol.source.TileImage.prototype.getGutterInternal = function() {
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@@ -230,6 +253,7 @@ ol.source.TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection
|
||||
sourceProjection, sourceTileGrid,
|
||||
projection, targetTileGrid,
|
||||
tileCoord, wrappedTileCoord, this.getTilePixelRatio(pixelRatio),
|
||||
this.getGutterInternal(),
|
||||
function(z, x, y, pixelRatio) {
|
||||
return this.getTileInternal(z, x, y, pixelRatio, sourceProjection);
|
||||
}.bind(this), this.reprojectionErrorThreshold_,
|
||||
|
||||
@@ -147,9 +147,10 @@ ol.source.Tile.prototype.forEachLoadedTile = function(projection, z, tileRange,
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @return {number} Gutter.
|
||||
*/
|
||||
ol.source.Tile.prototype.getGutter = function() {
|
||||
ol.source.Tile.prototype.getGutter = function(projection) {
|
||||
return 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ ol.source.TileWMS.prototype.getGetFeatureInfoUrl = function(coordinate, resoluti
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.source.TileWMS.prototype.getGutter = function() {
|
||||
ol.source.TileWMS.prototype.getGutterInternal = function() {
|
||||
return this.gutter_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user