Give tile grids a width
This commit is contained in:
@@ -143,15 +143,15 @@ ol.tilecoord.toString = function(tileCoord) {
|
||||
/**
|
||||
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
||||
* @param {ol.tilegrid.TileGrid} tilegrid Tile grid.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @return {ol.TileCoord} Tile coordinate.
|
||||
*/
|
||||
ol.tilecoord.wrapX = (function() {
|
||||
var tmpTileCoord = [0, 0, 0];
|
||||
return function(tileCoord, tileGrid, extent) {
|
||||
return function(tileCoord, tileGrid, projection) {
|
||||
var z = tileCoord[0];
|
||||
var x = tileCoord[1];
|
||||
var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z);
|
||||
var tileRange = tileGrid.getTileRange(z, projection);
|
||||
if (x < tileRange.minX || x > tileRange.maxX) {
|
||||
x = goog.math.modulo(x, tileRange.getWidth());
|
||||
return ol.tilecoord.createOrUpdate(z, x, tileCoord[2], tmpTileCoord);
|
||||
@@ -164,11 +164,12 @@ ol.tilecoord.wrapX = (function() {
|
||||
/**
|
||||
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
||||
* @param {ol.tilegrid.TileGrid} tileGrid Tile grid.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @return {ol.TileCoord} Tile coordinate.
|
||||
*/
|
||||
ol.tilecoord.clipX = function(tileCoord, tileGrid, extent) {
|
||||
ol.tilecoord.clipX = function(tileCoord, tileGrid, projection) {
|
||||
var z = tileCoord[0];
|
||||
var x = tileCoord[1];
|
||||
var tileRange = tileGrid.getTileRangeForExtentAndZ(extent, tileCoord[0]);
|
||||
var tileRange = tileGrid.getTileRange(z, projection);
|
||||
return (x < tileRange.minX || x > tileRange.maxX) ? null : tileCoord;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user