Merge pull request #6970 from cmortazavi/patch-1

Fix Bug when adding/removing layer with no cache
This commit is contained in:
Andreas Hocevar
2017-07-03 20:34:13 +02:00
committed by GitHub
+2
View File
@@ -152,8 +152,10 @@ ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSourc
*/ */
var postRenderFunction = function(tileSource, map, frameState) { var postRenderFunction = function(tileSource, map, frameState) {
var tileSourceKey = ol.getUid(tileSource).toString(); var tileSourceKey = ol.getUid(tileSource).toString();
if (tileSourceKey in frameState.usedTiles) {
tileSource.expireCache(frameState.viewState.projection, tileSource.expireCache(frameState.viewState.projection,
frameState.usedTiles[tileSourceKey]); frameState.usedTiles[tileSourceKey]);
}
}.bind(null, tileSource); }.bind(null, tileSource);
frameState.postRenderFunctions.push( frameState.postRenderFunctions.push(