From eac5d652cfdebb60d96ec5823cf12ac8e983f21a Mon Sep 17 00:00:00 2001 From: Petr Sloup Date: Thu, 2 Jul 2015 15:21:34 +0200 Subject: [PATCH] Check projection.canWrapX() before wrapping tiles Even if wrapX is true on the source --- src/ol/source/tilesource.js | 2 +- src/ol/source/tilevectorsource.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) ?