From 9c415ac9da094632ecfd0cf5d691404c70908d55 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Wed, 15 Apr 2015 08:12:17 +0200 Subject: [PATCH] Use simple tile sizes for Bing maps by default --- changelog/upgrade-notes.md | 2 +- src/ol/source/bingmapssource.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index d473ef0b5b..247368e163 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -118,7 +118,7 @@ size of a sub-rectangle in an image sprite. ### Support for non-square tiles -When using ´ol.tilegrid.TileGrid#getTileSize` on the tile grid of an `ol.source.BingMaps`, the return value will now be an `ol.Size` array instead of a number. +The return value of ´ol.tilegrid.TileGrid#getTileSize()` will now be an `ol.Size` array instead of a number if non-square tiles (i.e. an `ol.Size` array instead of a number as `tilsSize`) are used. To always get an `ol.Size`, the new `ol.size.toSize()` was added. ### v3.4.0 diff --git a/src/ol/source/bingmapssource.js b/src/ol/source/bingmapssource.js index 406102c437..f1eb3f415d 100644 --- a/src/ol/source/bingmapssource.js +++ b/src/ol/source/bingmapssource.js @@ -107,7 +107,8 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse = extent: ol.tilegrid.extentFromProjection(sourceProjection), minZoom: resource.zoomMin, maxZoom: maxZoom, - tileSize: [resource.imageWidth, resource.imageHeight] + tileSize: resource.imageWidth == resource.imageHeight ? + resource.imageWidth : [resource.imageWidth, resource.imageHeight] }); this.tileGrid = tileGrid;