]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.html.erb
It's zoomToExtent, not setExtent
[rails.git] / app / views / site / index.html.erb
index 6cff7f133fa674700f1bd117c53b3ebf665f5de6..9102214afb54190953150739b59017bf5c22ed22 100644 (file)
@@ -144,7 +144,7 @@ end
       <% if bbox %>
         var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);
 
       <% if bbox %>
         var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);
 
-        map.setExtent(proj(bbox));
+        map.zoomToExtent(proj(bbox));
 
         <% if box %>
           $(window).load(function() { addBoxToMap(bbox) });
 
         <% if box %>
           $(window).load(function() { addBoxToMap(bbox) });
@@ -200,7 +200,7 @@ end
     if (min_lon && min_lat && max_lon && max_lat) {
       var bbox = new OpenLayers.Bounds(min_lon, min_lat, max_lon, max_lat);
 
     if (min_lon && min_lat && max_lon && max_lat) {
       var bbox = new OpenLayers.Bounds(min_lon, min_lat, max_lon, max_lat);
 
-      map.setExtent(proj(bbox));
+      map.zoomToExtent(proj(bbox));
     } else {
       setMapCenter(centre, zoom);
     }
     } else {
       setMapCenter(centre, zoom);
     }