Remove forEachTileCoord

This commit is contained in:
Tom Payne
2013-01-14 16:00:45 +01:00
parent 8ced15ce2e
commit af88fb415b
2 changed files with 0 additions and 46 deletions

View File

@@ -71,22 +71,6 @@ ol.TileRange.prototype.equals = function(tileRange) {
};
/**
* @param {number} z Z.
* @param {function(this: T, ol.TileCoord)} f Callback.
* @param {T=} opt_obj The object to be used for the value of 'this' within f.
* @template T
*/
ol.TileRange.prototype.forEachTileCoord = function(z, f, opt_obj) {
var x, y;
for (x = this.minX; x <= this.maxX; ++x) {
for (y = this.minY; y <= this.maxY; ++y) {
f.call(opt_obj, new ol.TileCoord(z, x, y));
}
}
};
/**
* @inheritDoc
* @return {number} Height.

View File

@@ -51,36 +51,6 @@ describe('ol.TileRange', function() {
});
});
describe('forEachTileCoord', function() {
it('iterates as expected', function() {
var tileRange = new ol.TileRange(0, 2, 1, 3);
var tileCoords = [];
tileRange.forEachTileCoord(5, function(tileCoord) {
tileCoords.push(
new ol.TileCoord(tileCoord.z, tileCoord.x, tileCoord.y));
});
expect(tileCoords.length).toEqual(4);
expect(tileCoords[0].z).toEqual(5);
expect(tileCoords[0].x).toEqual(0);
expect(tileCoords[0].y).toEqual(2);
expect(tileCoords[1].z).toEqual(5);
expect(tileCoords[1].x).toEqual(0);
expect(tileCoords[1].y).toEqual(3);
expect(tileCoords[2].z).toEqual(5);
expect(tileCoords[2].x).toEqual(1);
expect(tileCoords[2].y).toEqual(2);
expect(tileCoords[3].z).toEqual(5);
expect(tileCoords[3].x).toEqual(1);
expect(tileCoords[3].y).toEqual(3);
});
});
describe('getSize', function() {
it('returns the expected size', function() {
var tileRange = new ol.TileRange(0, 1, 2, 4);