s/TileUrl/TileUrlFunction/

This commit is contained in:
Tom Payne
2012-07-08 12:21:35 +02:00
committed by Tom Payne
parent 58e9ba322e
commit d30c30f01d
3 changed files with 15 additions and 13 deletions
+20
View File
@@ -0,0 +1,20 @@
goog.require('goog.testing.jsunit');
goog.require('ol.TileCoord');
goog.require('ol.TileUrlFunction');
function testCreateFromTemplate() {
var tileUrl = ol.TileUrlFunction.createFromTemplate('{z}/{x}/{y}');
assertEquals('3/2/1', tileUrl(new ol.TileCoord(3, 2, 1)));
}
function testCreateFromTileUrlFunctions() {
var tileUrl = ol.TileUrlFunction.createFromTileUrlFunctions([
ol.TileUrlFunction.createFromTemplate('a'),
ol.TileUrlFunction.createFromTemplate('b')
]);
var tileUrl1 = tileUrl(new ol.TileCoord(1, 0, 0));
var tileUrl2 = tileUrl(new ol.TileCoord(1, 0, 1));
assertTrue(tileUrl1 != tileUrl2);
}