Allow '{-y}' placeholder

This commit is contained in:
Frederic Junod
2014-04-14 13:57:36 +02:00
parent 738fe65268
commit 9b5512c065
5 changed files with 105 additions and 6 deletions

View File

@@ -44,7 +44,11 @@ ol.TileUrlFunction.createFromTemplate = function(template) {
} else {
return template.replace('{z}', tileCoord.z.toString())
.replace('{x}', tileCoord.x.toString())
.replace('{y}', tileCoord.y.toString());
.replace('{y}', tileCoord.y.toString())
.replace('{-y}', function() {
var y = (1 << tileCoord.z) - tileCoord.y - 1;
return y.toString();
});
}
});
};