Check projection.canWrapX() before wrapping tiles
Even if wrapX is true on the source
This commit is contained in:
@@ -231,7 +231,7 @@ ol.source.Tile.prototype.getTileCoordForTileUrlFunction =
|
|||||||
opt_projection : this.getProjection();
|
opt_projection : this.getProjection();
|
||||||
var tileGrid = this.getTileGridForProjection(projection);
|
var tileGrid = this.getTileGridForProjection(projection);
|
||||||
goog.asserts.assert(!goog.isNull(tileGrid), 'tile grid needed');
|
goog.asserts.assert(!goog.isNull(tileGrid), 'tile grid needed');
|
||||||
if (this.getWrapX()) {
|
if (this.getWrapX() && projection.canWrapX()) {
|
||||||
tileCoord = ol.tilecoord.wrapX(tileCoord, tileGrid, projection);
|
tileCoord = ol.tilecoord.wrapX(tileCoord, tileGrid, projection);
|
||||||
}
|
}
|
||||||
return ol.tilecoord.withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null;
|
return ol.tilecoord.withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null;
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ ol.source.TileVector.prototype.getTileCoordForTileUrlFunction =
|
|||||||
function(tileCoord, projection) {
|
function(tileCoord, projection) {
|
||||||
var tileGrid = this.tileGrid_;
|
var tileGrid = this.tileGrid_;
|
||||||
goog.asserts.assert(!goog.isNull(tileGrid), 'tile grid needed');
|
goog.asserts.assert(!goog.isNull(tileGrid), 'tile grid needed');
|
||||||
if (this.getWrapX()) {
|
if (this.getWrapX() && projection.canWrapX()) {
|
||||||
tileCoord = ol.tilecoord.wrapX(tileCoord, tileGrid, projection);
|
tileCoord = ol.tilecoord.wrapX(tileCoord, tileGrid, projection);
|
||||||
}
|
}
|
||||||
return ol.tilecoord.withinExtentAndZ(tileCoord, tileGrid) ?
|
return ol.tilecoord.withinExtentAndZ(tileCoord, tileGrid) ?
|
||||||
|
|||||||
Reference in New Issue
Block a user