Remove tilerange assert from tilegrid/wmts
This commit is contained in:
@@ -85,10 +85,6 @@ Number of `tileSizes` and `resolutions` must be equal.
|
|||||||
|
|
||||||
Number of `origins` and `resolutions` must be equal.
|
Number of `origins` and `resolutions` must be equal.
|
||||||
|
|
||||||
### 21
|
|
||||||
|
|
||||||
Tile range for `extent` must not exceed tilegrid width and height.
|
|
||||||
|
|
||||||
### 22
|
### 22
|
||||||
|
|
||||||
Either `tileSize` or `tileSizes` must be configured, never both.
|
Either `tileSize` or `tileSizes` must be configured, never both.
|
||||||
|
|||||||
@@ -122,11 +122,6 @@ ol.tilegrid.TileGrid = function(options) {
|
|||||||
var tileRange = new ol.TileRange(
|
var tileRange = new ol.TileRange(
|
||||||
Math.min(0, size[0]), Math.max(size[0] - 1, -1),
|
Math.min(0, size[0]), Math.max(size[0] - 1, -1),
|
||||||
Math.min(0, size[1]), Math.max(size[1] - 1, -1));
|
Math.min(0, size[1]), Math.max(size[1] - 1, -1));
|
||||||
if (this.minZoom <= z && z <= this.maxZoom && extent !== undefined) {
|
|
||||||
ol.asserts.assert(tileRange.containsTileRange(
|
|
||||||
this.getTileRangeForExtentAndZ(extent, z)),
|
|
||||||
21); // Tile range for `extent` must not exceed tilegrid width and height
|
|
||||||
}
|
|
||||||
return tileRange;
|
return tileRange;
|
||||||
}, this);
|
}, this);
|
||||||
} else if (extent) {
|
} else if (extent) {
|
||||||
|
|||||||
@@ -159,28 +159,6 @@ describe('ol.tilegrid.TileGrid', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('create with extent exceeding tile ranges', function() {
|
|
||||||
it('throws an exception', function() {
|
|
||||||
expect(function() {
|
|
||||||
return new ol.tilegrid.TileGrid({
|
|
||||||
extent: [10, 20, 30, 40],
|
|
||||||
sizes: [[1, 1]],
|
|
||||||
tileSize: 10,
|
|
||||||
resolutions: [1]
|
|
||||||
});
|
|
||||||
}).to.throwException();
|
|
||||||
expect(function() {
|
|
||||||
return new ol.tilegrid.TileGrid({
|
|
||||||
extent: [10, 20, 30, 40],
|
|
||||||
origin: [10, 40], // top-left origin
|
|
||||||
sizes: [[3, 3]], // would have to be [[3, -3]] for this to not throw
|
|
||||||
tileSize: 10,
|
|
||||||
resolutions: [1]
|
|
||||||
});
|
|
||||||
}).to.throwException();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('create with origin', function() {
|
describe('create with origin', function() {
|
||||||
var tileGrid;
|
var tileGrid;
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user