]> git.openstreetmap.org Git - rails.git/blobdiff - public/javascripts/map.js
fix branching way problem
[rails.git] / public / javascripts / map.js
index fab00e81d924e81659331add94646d0ea3f4c98b..7b5c06bd045e33fc05e6487124bf1659330faf4b 100644 (file)
@@ -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;
    }
 }