Avoid infinite source tile cache size
This commit is contained in:
@@ -471,6 +471,9 @@ class VectorTile extends UrlTile {
|
|||||||
*/
|
*/
|
||||||
updateCacheSize(tileCount, projection) {
|
updateCacheSize(tileCount, projection) {
|
||||||
super.updateCacheSize(tileCount * 2, projection);
|
super.updateCacheSize(tileCount * 2, projection);
|
||||||
|
this.sourceTileCache.highWaterMark = this.getTileCacheForProjection(
|
||||||
|
projection
|
||||||
|
).highWaterMark;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -309,6 +309,18 @@ describe('ol.source.VectorTile', function () {
|
|||||||
done();
|
done();
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('adjusts the tile cache size', function (done) {
|
||||||
|
map.renderSync();
|
||||||
|
setTimeout(function () {
|
||||||
|
expect(
|
||||||
|
source.getTileCacheForProjection(map.getView().getProjection())
|
||||||
|
.highWaterMark
|
||||||
|
).to.be(2);
|
||||||
|
expect(source.sourceTileCache.highWaterMark).to.be(2);
|
||||||
|
done();
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not fill up the tile queue', function (done) {
|
it('does not fill up the tile queue', function (done) {
|
||||||
|
|||||||
Reference in New Issue
Block a user