Remove unused ol.TileRange.boundingTileRange function

This commit is contained in:
Frederic Junod
2016-09-15 10:12:45 +02:00
parent 175727c782
commit a4504b0e00
2 changed files with 0 additions and 49 deletions

View File

@@ -1,7 +1,5 @@
goog.provide('ol.TileRange');
goog.require('ol.asserts');
/**
* A representation of a contiguous block of tiles. A tile range is specified
@@ -39,34 +37,6 @@ ol.TileRange = function(minX, maxX, minY, maxY) {
};
/**
* @param {...ol.TileCoord} var_args Tile coordinates.
* @return {!ol.TileRange} Bounding tile box.
*/
ol.TileRange.boundingTileRange = function(var_args) {
var tileCoord0 = /** @type {ol.TileCoord} */ (arguments[0]);
var tileCoord0Z = tileCoord0[0];
var tileCoord0X = tileCoord0[1];
var tileCoord0Y = tileCoord0[2];
var tileRange = new ol.TileRange(tileCoord0X, tileCoord0X,
tileCoord0Y, tileCoord0Y);
var i, ii, tileCoord, tileCoordX, tileCoordY, tileCoordZ;
for (i = 1, ii = arguments.length; i < ii; ++i) {
tileCoord = /** @type {ol.TileCoord} */ (arguments[i]);
tileCoordZ = tileCoord[0];
tileCoordX = tileCoord[1];
tileCoordY = tileCoord[2];
ol.asserts.assert(tileCoordZ == tileCoord0Z,
23); // The passed `ol.TileCoord`s must all have the same `z` value
tileRange.minX = Math.min(tileRange.minX, tileCoordX);
tileRange.maxX = Math.max(tileRange.maxX, tileCoordX);
tileRange.minY = Math.min(tileRange.minY, tileCoordY);
tileRange.maxY = Math.max(tileRange.maxY, tileCoordY);
}
return tileRange;
};
/**
* @param {number} minX Minimum X.
* @param {number} maxX Maximum X.

View File

@@ -50,25 +50,6 @@ describe('ol.TileRange', function() {
});
});
describe('boundingTileRange', function() {
it('returns the expected TileRange', function() {
var tileRange = new ol.TileRange.boundingTileRange(
[3, 1, 3], [3, 2, 0]);
expect(tileRange.minX).to.eql(1);
expect(tileRange.maxX).to.eql(2);
expect(tileRange.minY).to.eql(0);
expect(tileRange.maxY).to.eql(3);
});
describe('with mixed z', function() {
it('returns the expected TileRange', function() {
expect(function() {
return new ol.TileRange.boundingTileRange([3, 1, 3], [4, 2, 0]);
}).to.throwException();
});
});
});
describe('equals', function() {
it('determines equivalence of two ranges', function() {
var one = new ol.TileRange(0, 2, 1, 4);