Add ol.source.WMTS#getUrls

This commit is contained in:
Éric Lemoine
2015-04-22 12:16:15 +02:00
parent 1d6530ce9c
commit 2a2fea379e
3 changed files with 75 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ goog.provide('ol.TileUrlFunction');
goog.provide('ol.TileUrlFunctionType');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.math');
goog.require('ol.TileCoord');
goog.require('ol.tilecoord');
@@ -74,6 +75,8 @@ ol.TileUrlFunction.createFromTemplates = function(templates) {
* @return {ol.TileUrlFunctionType} Tile URL function.
*/
ol.TileUrlFunction.createFromTileUrlFunctions = function(tileUrlFunctions) {
goog.asserts.assert(tileUrlFunctions.length > 0,
'Length of tile url functions should be greater than 0');
if (tileUrlFunctions.length === 1) {
return tileUrlFunctions[0];
}