new support for box=yes param on the homepage, and then link to this from various changeset display

This commit is contained in:
Harry Wood 2009-04-08 16:55:22 +00:00
parent 1f8a68371a
commit fdd5d2d779
7 changed files with 67 additions and 21 deletions

View file

@ -45,6 +45,7 @@ if params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat
minlat = h(params['minlat'])
maxlon = h(params['maxlon'])
maxlat = h(params['maxlat'])
box = true if params['box']=="yes"
end
# Decide on a lat lon to initialise the map with. Various ways of doing this
@ -109,13 +110,16 @@ end
var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);
setMapExtent(bbox);
<% if box %>
box = addBoxToMap(bbox);
<% end %>
<% else %>
var centre = new OpenLayers.LonLat(<%= lon %>, <%= lat %>);
var zoom = <%= zoom %>;
<% if params['scale'] and params['scale'].length > 0 then %>
<% if params['scale'] and params['scale'].length > 0 then %>
zoom = scaleToZoom(<%= params['scale'].to_f() %>);
<% end %>
<% end %>
setMapCenter(centre, zoom);
<% end %>