openlayers/ol3 — pull request #792 by vmx (2013-06-16 21:25:16+00:00)
Title: Allow async URL creation

If you can't construct a URL immediately, but need some
asynchronous call, you can return a function that receives
a callback as argument (that takes the final URL as
argument).

Example:

tileUrlFunction: function(tileCoord, projection) {
var stringCoord = [tileCoord.z, tileCoord.x, tileCoord.y]
.join('/');
return function(cb) {
window.setTimeout(function() {
var url =
'http://a.tile.openstreetmap.de/tiles/osmde/' +
stringCoord + '.png';
cb(url);
}, 1500);
};
}