Pass transformed tile coordinates to the tileUrlFunction

This commit is contained in:
Andreas Hocevar
2015-06-12 09:45:03 +02:00
parent fad3cf9672
commit 6a4d1c9b89
21 changed files with 189 additions and 350 deletions

View File

@@ -165,15 +165,15 @@ ol.tilecoord.wrapX = function(tileCoord, tileGrid, projection) {
/**
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {!ol.tilegrid.TileGrid} tileGrid Tile grid.
* @return {ol.TileCoord} Tile coordinate.
* @return {boolean} Tile coordinate is within extent and zoom level range.
*/
ol.tilecoord.restrictByExtentAndZ = function(tileCoord, tileGrid) {
ol.tilecoord.withinExtentAndZ = function(tileCoord, tileGrid) {
var z = tileCoord[0];
var x = tileCoord[1];
var y = tileCoord[2];
if (tileGrid.getMinZoom() > z || z > tileGrid.getMaxZoom()) {
return null;
return false;
}
var extent = tileGrid.getExtent();
var tileRange;
@@ -183,8 +183,8 @@ ol.tilecoord.restrictByExtentAndZ = function(tileCoord, tileGrid) {
tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
}
if (goog.isNull(tileRange)) {
return tileCoord;
return true;
} else {
return tileRange.containsXY(x, y) ? tileCoord : null;
return tileRange.containsXY(x, y);
}
};