]> git.openstreetmap.org Git - rails.git/blobdiff - public/javascripts/map.js
Reduce number of nearby people listed to the closest 5 by default, and show friends...
[rails.git] / public / javascripts / map.js
index 2f7d52e589b380ee99eb24b62a2e02484e04b38f..3f1b83af418c4a1575c750cde737e631eb56ffb3 100644 (file)
@@ -15,7 +15,7 @@ function createMap(divName) {
                               projection: "EPSG:41001" });
 
    var mapnik = new OpenLayers.Layer.TMS("Mapnik",
-                                         "http://tile.openstreetmap.org/",
+                                         ["http://a.tile.openstreetmap.org/","http://b.tile.openstreetmap.org/","http://c.tile.openstreetmap.org/"],
                                          { type: 'png', getURL: getTileURL, displayOutsideMaxExtent: true });
    map.addLayer(mapnik);
 
@@ -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;
    }
 }