Fix Bug when adding/removing layer with no cache

This commit is contained in:
cmortazavi
2017-06-28 09:55:37 -07:00
committed by Andreas Hocevar
parent 71b334d49c
commit db63cc1b23

View File

@@ -152,8 +152,10 @@ ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSourc
*/
var postRenderFunction = function(tileSource, map, frameState) {
var tileSourceKey = ol.getUid(tileSource).toString();
tileSource.expireCache(frameState.viewState.projection,
frameState.usedTiles[tileSourceKey]);
if (tileSourceKey in frameState.usedTiles) {
tileSource.expireCache(frameState.viewState.projection,
frameState.usedTiles[tileSourceKey]);
}
}.bind(null, tileSource);
frameState.postRenderFunctions.push(