Merge pull request #9251 from ahocevar/cache-size

Fix cache size calculation
This commit is contained in:
Andreas Hocevar
2019-02-21 01:57:40 +01:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ class TileSource extends Source {
if (tileGrid) {
toSize(tileGrid.getTileSize(tileGrid.getMinZoom()), tileSize);
}
const canUseScreen = 'screen ' in self;
const canUseScreen = 'screen' in self;
const width = canUseScreen ? (screen.availWidth || screen.width) : 1920;
const height = canUseScreen ? (screen.availHeight || screen.height) : 1080;
cacheSize = 4 * Math.ceil(width / tileSize[0]) * Math.ceil(height / tileSize[1]);