Propagate return value

This commit is contained in:
Tom Payne
2013-04-09 02:30:24 +02:00
parent cdc67a141a
commit e732a67382
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -96,6 +96,7 @@ ol.tilegrid.TileGrid = function(options) {
* @param {ol.TileCoord} tileCoord Tile coordinate. * @param {ol.TileCoord} tileCoord Tile coordinate.
* @param {function(this: T, number, ol.TileRange): boolean} callback Callback. * @param {function(this: T, number, ol.TileRange): boolean} callback Callback.
* @param {T=} opt_obj Object. * @param {T=} opt_obj Object.
* @return {boolean} Callback succeeded.
* @template T * @template T
*/ */
ol.tilegrid.TileGrid.prototype.forEachTileCoordParentTileRange = ol.tilegrid.TileGrid.prototype.forEachTileCoordParentTileRange =
@@ -105,10 +106,11 @@ ol.tilegrid.TileGrid.prototype.forEachTileCoordParentTileRange =
while (z >= 0) { while (z >= 0) {
if (callback.call( if (callback.call(
opt_obj, z, this.getTileRangeForExtentAndZ(tileCoordExtent, z))) { opt_obj, z, this.getTileRangeForExtentAndZ(tileCoordExtent, z))) {
return; return true;
} }
--z; --z;
} }
return false;
}; };
+2 -1
View File
@@ -64,7 +64,8 @@ ol.tilegrid.XYZ.prototype.forEachTileCoordParentTileRange =
tileRange.minX = tileRange.maxX >>= 1; tileRange.minX = tileRange.maxX >>= 1;
tileRange.minY = tileRange.maxY >>= 1; tileRange.minY = tileRange.maxY >>= 1;
if (callback.call(opt_obj, z, tileRange)) { if (callback.call(opt_obj, z, tileRange)) {
break; return true;
} }
} }
return false;
}; };