X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7318ee4b93a5dbcb7fece8553be65f2fb858e68a..92d284a67823dbcbafdb91d2c0d757755c8ff5fd:/app/views/site/_id.html.erb?ds=sidebyside diff --git a/app/views/site/_id.html.erb b/app/views/site/_id.html.erb index 6409582cd..a6f42e43c 100644 --- a/app/views/site/_id.html.erb +++ b/app/views/site/_id.html.erb @@ -8,6 +8,10 @@ var mapParams = OSM.mapParams(); if (mapParams.object) { params.id = mapParams.object.type[0] + mapParams.object.id; + mapParams = OSM.parseHash(location.hash); + if (mapParams.center) { + params.map = mapParams.zoom + '/' + mapParams.center.lng + '/' + mapParams.center.lat; + } } else { <% if @lat && @lon -%> params.map = '16/<%= @lon %>/<%= @lat %>'; @@ -22,9 +26,17 @@ params.background = hashParams.background; } + if (hashParams.comment) { + params.comment = hashParams.comment; + } + +<% if params[:gpx] -%> + params.gpx = '<%= trace_data_url(params[:gpx], :format => :xml) %>'; +<% else -%> if (hashParams.gpx) { params.gpx = hashParams.gpx; } +<% end -%> $('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>#' + querystring.stringify(params));