Respect the tileSize option for XYZ grids

This commit is contained in:
Tim Schaub
2014-08-18 23:37:09 -06:00
parent ee487ca308
commit 1ede97ae18
2 changed files with 13 additions and 7 deletions

View File

@@ -24,18 +24,16 @@ goog.require('ol.tilegrid.TileGrid');
* @api
*/
ol.tilegrid.XYZ = function(options) {
// TODO: accept a tileSize option
var tileSize = ol.DEFAULT_TILE_SIZE;
var extent = goog.isDef(options.extent) ?
options.extent : ol.proj.EPSG3857.EXTENT;
var resolutions = ol.tilegrid.resolutionsFromExtent(
extent, options.maxZoom, tileSize);
extent, options.maxZoom, options.tileSize);
goog.base(this, {
minZoom: options.minZoom,
origin: ol.extent.getCorner(extent, ol.extent.Corner.TOP_LEFT),
resolutions: resolutions,
tileSize: tileSize
tileSize: options.tileSize
});
};