X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/c941bc197cfa499ec140025715e8fac0b9a1f95e..7bdfa0afc9a3c7cafba702e9bc05e9310053da68:/public/javascripts/map.js diff --git a/public/javascripts/map.js b/public/javascripts/map.js index fab00e81d..7b5c06bd0 100644 --- a/public/javascripts/map.js +++ b/public/javascripts/map.js @@ -20,7 +20,7 @@ function createMap(divName) { map.addLayer(mapnik); var osmarender = new OpenLayers.Layer.TMS("Osmarender", - "http://dev.openstreetmap.org/~ojw/Tiles/tile.php/", + ["http://a.tah.openstreetmap.org/Tiles/tile.php/","http://b.tah.openstreetmap.org/Tiles/tile.php/","http://c.tah.openstreetmap.org/Tiles/tile.php/"], { type: 'png', getURL: getTileURL, displayOutsideMaxExtent: true }); map.addLayer(osmarender); @@ -47,7 +47,15 @@ function getTileURL(bounds) { { x = ((x % limit) + limit) % limit; - return this.url + z + "/" + x + "/" + y + "." + this.type; + var url = this.url; + var path = z + "/" + x + "/" + y + "." + this.type; + + if (url instanceof Array) + { + url = this.selectUrl(path, url); + } + + return url + path; } }