]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/index.rhtml
new support for box=yes param on the homepage, and then link to this from various...
[rails.git] / app / views / site / index.rhtml
index 35509f4e0c071d994a6407401cf45cc52f7e6e17..66f69960b496540e561f8bf50881dfe0f3210243 100644 (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 %>