X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6cd8db7bff35f8b401eb904e4c24936d8fc09a0a..d2bd78627e3903e990ddb28aebb39653ebb22fcd:/app/views/site/index.rhtml diff --git a/app/views/site/index.rhtml b/app/views/site/index.rhtml index b9525c71a..9f5088038 100644 --- a/app/views/site/index.rhtml +++ b/app/views/site/index.rhtml @@ -1,6 +1,8 @@ <% content_for :greeting do %> +<% if !@user.home_lon.nil? and !@user.home_lat.nil? %> <%= link_to_function 'home', "setPosition(#{@user.home_lat}, #{@user.home_lon}, 10)" %> | <% end %> +<% end %> <% content_for :left_menu do %> <%= link_to "Map key", "http://wiki.openstreetmap.org/index.php/Map_Key" %> @@ -100,6 +102,10 @@ handleResize(); } + function getPosition() { + return mercatorToLonLat(map.getCenter()); + } + function setPosition(lat, lon, zoom) { var centre = lonLatToMercator(new OpenLayers.LonLat(lon, lat));