s/forEachTileCoordParent/forEachTileCoordParentTileBounds/
This commit is contained in:
@@ -77,13 +77,17 @@ ol.TileGrid = function(resolutions, extent, origin, opt_tileSize) {
|
||||
|
||||
/**
|
||||
* @param {ol.TileCoord} tileCoord Tile coordinate.
|
||||
* @param {function(number, ol.TileBounds): boolean} callback Callback.
|
||||
* @param {function(this: T, number, ol.TileBounds): boolean} callback Callback.
|
||||
* @param {T=} opt_obj Object.
|
||||
* @template T
|
||||
*/
|
||||
ol.TileGrid.prototype.forEachTileCoordParent = function(tileCoord, callback) {
|
||||
ol.TileGrid.prototype.forEachTileCoordParentTileBounds =
|
||||
function(tileCoord, callback, opt_obj) {
|
||||
var tileCoordExtent = this.getTileCoordExtent(tileCoord);
|
||||
var z = tileCoord.z - 1;
|
||||
while (z >= 0) {
|
||||
if (callback(z, this.getTileBoundsForExtentAndZ(tileCoordExtent, z))) {
|
||||
if (callback.call(
|
||||
opt_obj, z, this.getTileBoundsForExtentAndZ(tileCoordExtent, z))) {
|
||||
return;
|
||||
}
|
||||
--z;
|
||||
|
||||
@@ -398,7 +398,7 @@ function testForEachTileCoordParent() {
|
||||
var tileGrid = new ol.TileGrid(resolutions, extent, origin, tileSize);
|
||||
var zs = [], tileBoundss = [];
|
||||
|
||||
tileGrid.forEachTileCoordParent(
|
||||
tileGrid.forEachTileCoordParentTileBounds(
|
||||
new ol.TileCoord(3, 7, 3),
|
||||
function(z, tileBounds) {
|
||||
zs.push(z);
|
||||
|
||||
Reference in New Issue
Block a user