It's zoomToExtent, not setExtent
This commit is contained in:
parent
13a98cf7eb
commit
770a990ed9
3 changed files with 5 additions and 5 deletions
|
@ -79,7 +79,7 @@
|
||||||
var bbox = new OpenLayers.Bounds(minlon, minlat, maxlon, maxlat);
|
var bbox = new OpenLayers.Bounds(minlon, minlat, maxlon, maxlat);
|
||||||
var centre = bbox.getCenterLonLat();
|
var centre = bbox.getCenterLonLat();
|
||||||
|
|
||||||
map.setExtent(proj(bbox));
|
map.zoomToExtent(proj(bbox));
|
||||||
addBoxToMap(bbox);
|
addBoxToMap(bbox);
|
||||||
|
|
||||||
$("#loading").hide();
|
$("#loading").hide();
|
||||||
|
|
|
@ -80,9 +80,9 @@
|
||||||
selectControl.activate();
|
selectControl.activate();
|
||||||
|
|
||||||
<% if ! @bbox.nil? %>
|
<% 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 %>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@ end
|
||||||
<% if bbox %>
|
<% if bbox %>
|
||||||
var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);
|
var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);
|
||||||
|
|
||||||
map.setExtent(proj(bbox));
|
map.zoomToExtent(proj(bbox));
|
||||||
|
|
||||||
<% if box %>
|
<% if box %>
|
||||||
$(window).load(function() { addBoxToMap(bbox) });
|
$(window).load(function() { addBoxToMap(bbox) });
|
||||||
|
@ -200,7 +200,7 @@ end
|
||||||
if (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);
|
var bbox = new OpenLayers.Bounds(min_lon, min_lat, max_lon, max_lat);
|
||||||
|
|
||||||
map.setExtent(proj(bbox));
|
map.zoomToExtent(proj(bbox));
|
||||||
} else {
|
} else {
|
||||||
setMapCenter(centre, zoom);
|
setMapCenter(centre, zoom);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue