]> git.openstreetmap.org Git - rails.git/commitdiff
It's zoomToExtent, not setExtent
authorTom Hughes <tom@compton.nu>
Thu, 15 Mar 2012 17:01:16 +0000 (17:01 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 15 Mar 2012 17:01:16 +0000 (17:01 +0000)
app/views/browse/_map.html.erb
app/views/changeset/_map.html.erb
app/views/site/index.html.erb

index 333fc9f30979550871e7e3922f115cb75f4fef97..fda602bf0ac57e462359d69daa88aa6b4de24886 100644 (file)
@@ -79,7 +79,7 @@
         var bbox = new OpenLayers.Bounds(minlon, minlat, maxlon, maxlat);
         var centre = bbox.getCenterLonLat();
 
         var bbox = new OpenLayers.Bounds(minlon, minlat, maxlon, maxlat);
         var centre = bbox.getCenterLonLat();
 
-        map.setExtent(proj(bbox));
+        map.zoomToExtent(proj(bbox));
         addBoxToMap(bbox);
 
         $("#loading").hide();
         addBoxToMap(bbox);
 
         $("#loading").hide();
index f052eadbe74828d5c410e9b1f1eb2f57ea2aec4f..88dd53c99a8e7847ee51119148bca318ea72405a 100644 (file)
@@ -80,9 +80,9 @@
     selectControl.activate();
 
     <% if ! @bbox.nil? %>
     selectControl.activate();
 
     <% if ! @bbox.nil? %>
-      map.setExtent(proj(new OpenLayers.Bounds(<%= @bbox %>)));
+      map.zoomToExtent(proj(new OpenLayers.Bounds(<%= @bbox %>)));
     <% else %>
     <% else %>
-      map.setExtent(proj(bounds));
+      map.zoomToExtent(proj(bounds));
     <% end %>
   }
 
     <% end %>
   }
 
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);
     }