diff --git a/src/ol/source/tilesource.js b/src/ol/source/tilesource.js index 9e6527428e..6e2f4e45d3 100644 --- a/src/ol/source/tilesource.js +++ b/src/ol/source/tilesource.js @@ -231,7 +231,7 @@ ol.source.Tile.prototype.getTileCoordForTileUrlFunction = opt_projection : this.getProjection(); var tileGrid = this.getTileGridForProjection(projection); goog.asserts.assert(!goog.isNull(tileGrid), 'tile grid needed'); - if (this.getWrapX()) { + if (this.getWrapX() && projection.canWrapX()) { tileCoord = ol.tilecoord.wrapX(tileCoord, tileGrid, projection); } return ol.tilecoord.withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null; diff --git a/src/ol/source/tilevectorsource.js b/src/ol/source/tilevectorsource.js index 2be9959603..67c2dcebb4 100644 --- a/src/ol/source/tilevectorsource.js +++ b/src/ol/source/tilevectorsource.js @@ -254,7 +254,7 @@ ol.source.TileVector.prototype.getTileCoordForTileUrlFunction = function(tileCoord, projection) { var tileGrid = this.tileGrid_; goog.asserts.assert(!goog.isNull(tileGrid), 'tile grid needed'); - if (this.getWrapX()) { + if (this.getWrapX() && projection.canWrapX()) { tileCoord = ol.tilecoord.wrapX(tileCoord, tileGrid, projection); } return ol.tilecoord.withinExtentAndZ(tileCoord, tileGrid) ?