X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/231bdf66cdc8239c37e1536be4fb52ce275219e3..0b84885cfc566fb2d552c5681c11a2905d28f038:/app/views/site/index.rhtml diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index 99024f176..a69a6b4ee 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -1,6 +1,6 @@ <% content_for :greeting do %> <% if @user and !@user.home_lon.nil? and !@user.home_lat.nil? %> -<%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> | + <%= link_to_function t('layouts.home'), "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)", { :title => t('layouts.home_tooltip') } %> | <% end %> <% end %> @@ -10,24 +10,28 @@
- +
- - + + - +
http://creativecommons.org/licenses/by-sa/2.0/http://openstreetmap.org/<%= t'site.index.license.license_url' %><%= t'site.index.license.project_url' %>
Licensed under the Creative Commons Attribution-Share Alike 2.0 license by the OpenStreetMap project and its contributors.<%= + t'site.index.license.notice', + :license_name => t('site.index.license.license_name'), + :project_name => t('site.index.license.project_name') + %>
@@ -45,6 +49,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 @@ -96,11 +101,13 @@ end var marker; var map; + OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>"); + function mapInit(){ map = createMap("map"); <% unless OSM_STATUS == :api_offline or OSM_STATUS == :database_offline %> - map.dataLayer = new OpenLayers.Layer("Data", { "visibility": false }); + map.dataLayer = new OpenLayers.Layer("<%= I18n.t 'browse.start_rjs.data_layer_name' %>", { "visibility": false }); map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData); map.addLayer(map.dataLayer); <% end %> @@ -109,13 +116,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 %> @@ -164,10 +175,13 @@ end var lonlat = getMapCenter(); var zoom = map.getZoom(); var layers = getMapLayers(); + var extents = getMapExtent(); + var expiry = new Date(); - updatelinks(lonlat.lon, lonlat.lat, zoom, layers); + 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; + expiry.setYear(expiry.getFullYear() + 10); + document.cookie = "_osm_location=" + lonlat.lon + "|" + lonlat.lat + "|" + zoom + "|" + layers + "; expires=" + expiry.toGMTString(); } function resizeContent() {