X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/48a3ee4d2460df20ce3108f56631005d06f0a9c9..10e13b8feacca7bdd04f335a5b7badc3e6ae8dba:/app/views/site/index.rhtml diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index 80746ba07..aa808085f 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -14,7 +14,9 @@ <% lon = params['mlon'] %> <% lat = params['mlat'] %> <% zoom = params['zoom'] || '12' %> -<% elsif @user %> +<% elsif cookies.key?("location") %> +<% lon,lat,zoom = cookies["location"].value.first.split(",") %> +<% elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil? %> <% lon = @user.home_lon %> <% lat = @user.home_lat %> <% zoom = '10' %> @@ -73,6 +75,8 @@ var zoom = map.getZoom(); updatelinks(lonlat.lon, lonlat.lat, zoom); + + document.cookie = "location=" + lonlat.lon + "," + lonlat.lat + "," + zoom; } function getStyle( el, property ) {