Sources may be configured with a projection, tile grids with an extent

An XYZ tile grid is constructed with an extent defining the bounds of the tile grid.
This commit is contained in:
Tim Schaub
2014-08-18 23:26:36 -06:00
parent e97f79b4ab
commit ee487ca308
5 changed files with 25 additions and 22 deletions

View File

@@ -89,7 +89,9 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse =
var resource = response.resourceSets[0].resources[0];
goog.asserts.assert(resource.imageWidth == resource.imageHeight);
var sourceProjection = this.getProjection();
var tileGrid = new ol.tilegrid.XYZ({
extent: ol.tilegrid.extentFromProjection(sourceProjection),
minZoom: resource.zoomMin,
maxZoom: resource.zoomMax,
tileSize: resource.imageWidth
@@ -97,7 +99,6 @@ ol.source.BingMaps.prototype.handleImageryMetadataResponse =
this.tileGrid = tileGrid;
var culture = this.culture_;
var sourceProjection = this.getProjection();
this.tileUrlFunction = ol.TileUrlFunction.withTileCoordTransform(
tileGrid.createTileCoordTransform(),
ol.TileUrlFunction.createFromTileUrlFunctions(