Use opt_this instead of opt_obj in ol.tilegrid.TileGrid

This commit is contained in:
Tom Payne
2014-01-15 15:09:31 +01:00
parent 4a18554353
commit af8e92c0bf
2 changed files with 5 additions and 5 deletions

View File

@@ -115,18 +115,18 @@ ol.tilegrid.TileGrid.prototype.createTileCoordTransform = goog.abstractMethod;
/**
* @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {function(this: T, number, ol.TileRange): boolean} callback Callback.
* @param {T=} opt_obj Object.
* @param {T=} opt_this The object to use as `this` in `callback`.
* @param {ol.TileRange=} opt_tileRange Temporary ol.TileRange object.
* @param {ol.Extent=} opt_extent Temporary ol.Extent object.
* @return {boolean} Callback succeeded.
* @template T
*/
ol.tilegrid.TileGrid.prototype.forEachTileCoordParentTileRange =
function(tileCoord, callback, opt_obj, opt_tileRange, opt_extent) {
function(tileCoord, callback, opt_this, opt_tileRange, opt_extent) {
var tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent);
var z = tileCoord.z - 1;
while (z >= this.minZoom) {
if (callback.call(opt_obj, z,
if (callback.call(opt_this, z,
this.getTileRangeForExtentAndZ(tileCoordExtent, z, opt_tileRange))) {
return true;
}

View File

@@ -114,14 +114,14 @@ ol.tilegrid.XYZ.prototype.getTileCoordChildTileRange =
* @inheritDoc
*/
ol.tilegrid.XYZ.prototype.forEachTileCoordParentTileRange =
function(tileCoord, callback, opt_obj, opt_tileRange) {
function(tileCoord, callback, opt_this, opt_tileRange) {
var tileRange = ol.TileRange.createOrUpdate(
0, tileCoord.x, 0, tileCoord.y, opt_tileRange);
var z;
for (z = tileCoord.z - 1; z >= this.minZoom; --z) {
tileRange.minX = tileRange.maxX >>= 1;
tileRange.minY = tileRange.maxY >>= 1;
if (callback.call(opt_obj, z, tileRange)) {
if (callback.call(opt_this, z, tileRange)) {
return true;
}
}