Fix {-y} template calculation for custom (TMS) tile grids

Previously, {-y} only worked for the standard web mercator tile grid. Now
a tile grid with an extent is required (which we get from
ol.tilegrid.createXYZ() anyway), and then the y calculation for TMS style
tile grids works as expected.
This commit is contained in:
Andreas Hocevar
2015-09-28 16:37:21 +02:00
parent 79766ad25c
commit 8248ec63ba
6 changed files with 58 additions and 25 deletions

View File

@@ -75,7 +75,8 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
});
this.tileGrid = tileGrid;
this.tileUrlFunction = ol.TileUrlFunction.createFromTemplates(tileJSON.tiles);
this.tileUrlFunction =
ol.TileUrlFunction.createFromTemplates(tileJSON.tiles, tileGrid);
if (tileJSON.attribution !== undefined &&
goog.isNull(this.getAttributions())) {