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();
selectControl.activate();
<% if ! @bbox.nil? %>
- map.setExtent(proj(new OpenLayers.Bounds(<%= @bbox %>)));
+ map.zoomToExtent(proj(new OpenLayers.Bounds(<%= @bbox %>)));
<% else %>
- map.setExtent(proj(bounds));
+ map.zoomToExtent(proj(bounds));
<% end %>
}
<% 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 (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);
}