Single tileUrlFunction in createFromTileUrlFunctions
In that case, simply return the single tileUrlFunction.
This commit is contained in:
@@ -113,8 +113,6 @@ ol.source.WMTS = function(wmtsOptions) {
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: update createFromTileUrlFunctions so that if
|
||||
// tileUrlFunctions.length == 1, it returns the only tileUrlFunction
|
||||
var tileUrlFunction = ol.TileUrlFunction.createFromTileUrlFunctions(
|
||||
goog.array.map(urls, function(url) {
|
||||
if (goog.isDef(kvpParams)) {
|
||||
|
||||
@@ -60,6 +60,9 @@ ol.TileUrlFunction.createFromTemplates = function(templates) {
|
||||
* @return {ol.TileUrlFunctionType} Tile URL function.
|
||||
*/
|
||||
ol.TileUrlFunction.createFromTileUrlFunctions = function(tileUrlFunctions) {
|
||||
if (tileUrlFunctions.length === 1) {
|
||||
return tileUrlFunctions[0];
|
||||
}
|
||||
return function(tileCoord, tileGrid, projection) {
|
||||
if (goog.isNull(tileCoord)) {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user