Fix reprojection of raster sources with gutter

This commit is contained in:
Petr Sloup
2016-01-26 17:05:49 +01:00
parent ccf47de448
commit 59574da74c
11 changed files with 53 additions and 16 deletions

View File

@@ -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_,

View File

@@ -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;
};

View File

@@ -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_;
};