X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/1f8a68371ad34594cce4aadf5fef229588fd4ddc..f2f9d797d5925524f5d04cf5f1f4e90b181f0440:/app/views/site/index.rhtml diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index 35509f4e0..53a4c9a07 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -10,14 +10,14 @@
- +
@@ -27,7 +27,7 @@ http://openstreetmap.org/ - Licensed under the Creative Commons Attribution-Share Alike 2.0 license by the OpenStreetMap project and its contributors. + <%= t 'site.index.license' %>
@@ -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,17 @@ end 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 %> @@ -166,8 +171,8 @@ 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; }