diff --git a/src/ol/source/BingMaps.js b/src/ol/source/BingMaps.js index bbfbbbe557..c12e5d9aa7 100644 --- a/src/ol/source/BingMaps.js +++ b/src/ol/source/BingMaps.js @@ -45,6 +45,48 @@ const TOS_ATTRIBUTION = '} resourceSets The array of resource sets + */ + + +/** + * @typedef {Object} ResourceSet + * @property {Array} resources + */ + + +/** + * @typedef {Object} Resource + * @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} imageUrlSubdomains The image URL subdomains for rotation + * @property {Array} [imageryProviders] The array of ImageryProviders + */ + + +/** + * @typedef {Object} ImageryProvider + * @property {Array} coverageAreas The coverage areas + * @property {string} [attribution] The attribution + */ + + +/** + * @typedef {Object} CoverageArea + * @property {number} zoomMin The minimum zoom + * @property {number} zoomMax The maximum zoom + * @property {Array} bbox The coverage bounding box + */ + + /** * @classdesc * Layer source for Bing Maps tile data. @@ -150,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;