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:
@@ -87,7 +87,7 @@ ol.source.XYZ.prototype.getUrls = function() {
|
||||
*/
|
||||
ol.source.XYZ.prototype.setUrl = function(url) {
|
||||
this.setTileUrlFunction(ol.TileUrlFunction.createFromTemplates(
|
||||
ol.TileUrlFunction.expandUrl(url)));
|
||||
ol.TileUrlFunction.expandUrl(url), this.tileGrid));
|
||||
this.urls_ = [url];
|
||||
};
|
||||
|
||||
@@ -97,6 +97,7 @@ ol.source.XYZ.prototype.setUrl = function(url) {
|
||||
* @param {Array.<string>} urls URLs.
|
||||
*/
|
||||
ol.source.XYZ.prototype.setUrls = function(urls) {
|
||||
this.setTileUrlFunction(ol.TileUrlFunction.createFromTemplates(urls));
|
||||
this.setTileUrlFunction(
|
||||
ol.TileUrlFunction.createFromTemplates(urls, this.tileGrid));
|
||||
this.urls_ = urls;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user