Only schedule the icon cache expire when it's needed

This commit is contained in:
Frederic Junod
2018-12-19 14:25:02 +01:00
parent a4fe067aad
commit 3193de0906
3 changed files with 12 additions and 3 deletions

View File

@@ -280,7 +280,9 @@ class MapRenderer extends Disposable {
* @protected
*/
scheduleExpireIconCache(frameState) {
frameState.postRenderFunctions.push(/** @type {import("../PluggableMap.js").PostRenderFunction} */ (expireIconCache));
if (iconImageCache.canExpireCache()) {
frameState.postRenderFunctions.push(expireIconCache);
}
}
/**