From 1c10bbf94cf6d5641f23b82cb3b1e17577515830 Mon Sep 17 00:00:00 2001 From: William Wall Date: Fri, 21 Sep 2018 11:57:25 -0600 Subject: [PATCH] Fix arithmetic error on potential array And also add zoomMax to response type --- src/ol/source/BingMaps.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ol/source/BingMaps.js b/src/ol/source/BingMaps.js index 914e64288b..c12e5d9aa7 100644 --- a/src/ol/source/BingMaps.js +++ b/src/ol/source/BingMaps.js @@ -65,6 +65,7 @@ const TOS_ATTRIBUTION = '} imageUrlSubdomains The image URL subdomains for rotation * @property {Array} [imageryProviders] The array of ImageryProviders @@ -191,13 +192,16 @@ class BingMaps extends TileImage { const sourceProjection = this.getProjection(); const extent = extentFromProjection(sourceProjection); + const scale = this.hidpi_ ? 2 : 1; const tileSize = resource.imageWidth == resource.imageHeight ? - resource.imageWidth : [resource.imageWidth, resource.imageHeight]; + resource.imageWidth / scale : + [resource.imageWidth / scale, resource.imageHeight / scale]; + const tileGrid = createXYZ({ extent: extent, minZoom: resource.zoomMin, maxZoom: maxZoom, - tileSize: tileSize / (this.hidpi_ ? 2 : 1) + tileSize: tileSize }); this.tileGrid = tileGrid;