Transform tile coords when converting them to URLs

This commit is contained in:
Tom Payne
2012-07-15 16:23:03 +02:00
parent b4c9c1e846
commit 1d567bb2bf
5 changed files with 73 additions and 6 deletions

View File

@@ -9,6 +9,16 @@ function testCreateFromTemplate() {
}
function testWithTileCoordTransform() {
var tileUrl = ol.TileUrlFunction.withTileCoordTransform(
function(tileCoord) {
return new ol.TileCoord(tileCoord.z, tileCoord.x, -tileCoord.y);
},
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'),