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
var bbox = new OpenLayers.Bounds(<%= minlon %>, <%= minlat %>, <%= maxlon %>, <%= maxlat %>);
setMapExtent(bbox);
+ <% if box %>
+ // IE requires Vector layers be initialised on page load, and not under deferred script conditions
+ Event.observe(window, 'load', function() {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 %>
var layers = getMapLayers();
var extents = getMapExtent();
- updatelinks(lonlat.lon, lonlat.lat, zoom, layers, extents);
-
+ updatelinks(lonlat.lon, lonlat.lat, zoom, layers, extents.left, extents.bottom, extents.right, extents.top);
+
document.cookie = "_osm_location=" + lonlat.lon + "|" + lonlat.lat + "|" + zoom + "|" + layers;
}