Fix arithmetic error on potential array

And also add zoomMax to response type
This commit is contained in:
William Wall
2018-09-21 11:57:25 -06:00
parent fd0d6ff6f6
commit 1c10bbf94c

View File

@@ -65,6 +65,7 @@ const TOS_ATTRIBUTION = '<a class="ol-attribution-bing-tos" ' +
* @property {number} imageHeight The image height
* @property {number} imageWidth The image width
* @property {number} zoomMin The minimum zoom level
* @property {number} zoomMax The maximum zoom level
* @property {string} imageUrl The image URL
* @property {Array<string>} imageUrlSubdomains The image URL subdomains for rotation
* @property {Array<ImageryProvider>} [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;