Configure cache on the layer instead of the source
This commit is contained in:
@@ -5,7 +5,7 @@ import WebGLHelper from '../../../../../src/ol/webgl/Helper.js';
|
||||
import WebGLTileLayer from '../../../../../src/ol/layer/WebGLTile.js';
|
||||
import {createCanvasContext2D} from '../../../../../src/ol/dom.js';
|
||||
|
||||
describe('ol.layer.Tile', function () {
|
||||
describe('ol/layer/WebGLTile', function () {
|
||||
/** @type {WebGLTileLayer} */
|
||||
let layer;
|
||||
/** @type {Map} */
|
||||
@@ -120,6 +120,17 @@ describe('ol.layer.Tile', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('tries to expire the source tile cache', (done) => {
|
||||
const source = layer.getSource();
|
||||
const expire = sinon.spy(source, 'expireCache');
|
||||
|
||||
layer.updateStyleVariables({r: 1, g: 2, b: 3});
|
||||
map.once('rendercomplete', () => {
|
||||
expect(expire.called).to.be(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('throws on incorrect style configs', function () {
|
||||
function incorrectStyle() {
|
||||
layer.style_ = {
|
||||
|
||||
Reference in New Issue
Block a user