Respect cacheSize for reprojected caches
This commit is contained in:
@@ -12,9 +12,10 @@ goog.require('ol.tilegrid');
|
||||
|
||||
|
||||
describe('ol.source.TileImage', function() {
|
||||
function createSource(opt_proj, opt_tileGrid) {
|
||||
function createSource(opt_proj, opt_tileGrid, opt_cacheSize) {
|
||||
var proj = opt_proj || 'EPSG:3857';
|
||||
return new ol.source.TileImage({
|
||||
cacheSize: opt_cacheSize,
|
||||
projection: proj,
|
||||
tileGrid: opt_tileGrid ||
|
||||
ol.tilegrid.createForProjection(proj, undefined, [2, 2]),
|
||||
@@ -23,6 +24,15 @@ describe('ol.source.TileImage', function() {
|
||||
});
|
||||
}
|
||||
|
||||
describe('#getTileCacheForProjection', function() {
|
||||
it('uses the cacheSize for reprojected tile caches', function() {
|
||||
var source = createSource(undefined, undefined, 42);
|
||||
var tileCache = source.getTileCacheForProjection(ol.proj.get('EPSG:4326'));
|
||||
expect(tileCache.highWaterMark).to.be(42);
|
||||
expect(tileCache).to.not.equal(source.getTileCacheForProjection(source.getProjection()));
|
||||
});
|
||||
});
|
||||
|
||||
describe('#setTileGridForProjection', function() {
|
||||
it('uses the tilegrid for given projection', function() {
|
||||
var source = createSource();
|
||||
|
||||
Reference in New Issue
Block a user