Expand urls before setting this.urls

This commit is contained in:
Andreas Hocevar
2016-02-01 17:58:38 +01:00
committed by Frederic Junod
parent b9b4778d05
commit 04db1c3e4d

View File

@@ -182,9 +182,9 @@ ol.source.UrlTile.prototype.setTileUrlFunction = function(tileUrlFunction) {
* @api stable
*/
ol.source.UrlTile.prototype.setUrl = function(url) {
this.urls = [url];
var urls = ol.TileUrlFunction.expandUrl(url);
this.setTileUrlFunction(this.fixedTileUrlFunction ||
var urls = this.urls = ol.TileUrlFunction.expandUrl(url);
this.setTileUrlFunction(this.fixedTileUrlFunction ?
this.fixedTileUrlFunction.bind(this) :
ol.TileUrlFunction.createFromTemplates(urls, this.tileGrid));
};