From 45f2324a4ed3d3e1ab87e81084d9e58294bd1286 Mon Sep 17 00:00:00 2001 From: William Wall Date: Wed, 19 Sep 2018 10:02:33 -0600 Subject: [PATCH] Get width as number from number|Size This satisfies tsc in addition to being a bit more defensive from custom tile grids, even if using them is very uncommon for this source. --- src/ol/source/Zoomify.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ol/source/Zoomify.js b/src/ol/source/Zoomify.js index 1bb712c46f..25793f712c 100644 --- a/src/ol/source/Zoomify.js +++ b/src/ol/source/Zoomify.js @@ -219,7 +219,8 @@ class Zoomify extends TileImage { tileCoordX + tileCoordY * tierSizeInTiles[tileCoordZ][0]; const tileSize = tileGrid.getTileSize(tileCoordZ); - const tileGroup = ((tileIndex + tileCountUpToTier[tileCoordZ]) / tileSize) | 0; + const tileWidth = Array.isArray(tileSize) ? tileSize[0] : tileSize; + const tileGroup = ((tileIndex + tileCountUpToTier[tileCoordZ]) / tileWidth) | 0; const localContext = { 'z': tileCoordZ, 'x': tileCoordX,