Merge pull request #7379 from lasselaakkonen/6608-zoomify-custom-tile-size
Add support for custom tile size to Zoomify source
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.dom');
|
||||
goog.require('ol.events');
|
||||
goog.require('ol.proj.Projection');
|
||||
@@ -30,6 +31,13 @@ describe('ol.source.Zoomify', function() {
|
||||
size: size
|
||||
});
|
||||
}
|
||||
function getZoomifySourceWith1024pxTiles() {
|
||||
return new ol.source.Zoomify({
|
||||
url: zoomifyUrl,
|
||||
size: size,
|
||||
tileSize: 1024
|
||||
});
|
||||
}
|
||||
|
||||
describe('constructor', function() {
|
||||
|
||||
@@ -148,6 +156,14 @@ describe('ol.source.Zoomify', function() {
|
||||
}
|
||||
});
|
||||
|
||||
it('has expected tileSize', function() {
|
||||
var sources = [getZoomifySource(), getZoomifySourceWith1024pxTiles()];
|
||||
var expectedTileSizes = [ol.DEFAULT_TILE_SIZE, 1024];
|
||||
for (var i = 0; i < sources.length; i++) {
|
||||
var tileGrid = sources[i].getTileGrid();
|
||||
expect(tileGrid.getTileSize()).to.eql(expectedTileSizes[i]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('tierSizeCalculation configuration', function() {
|
||||
@@ -232,11 +248,6 @@ describe('ol.source.Zoomify', function() {
|
||||
|
||||
describe('uses a custom tileClass', function() {
|
||||
|
||||
it('uses "ol.source.Zoomify.Tile_" as tileClass', function() {
|
||||
var source = getZoomifySource();
|
||||
expect(source.tileClass).to.be(ol.source.Zoomify.Tile_);
|
||||
});
|
||||
|
||||
it('returns expected tileClass instances via "getTile"', function() {
|
||||
var source = getZoomifySource();
|
||||
var tile = source.getTile(0, 0, -1, 1, proj);
|
||||
|
||||
Reference in New Issue
Block a user