X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/99775524b35017256203903962990c9dd212dbb4..963827d396959b856363417cc74749e79925c892:/app/views/site/_id.html.erb diff --git a/app/views/site/_id.html.erb b/app/views/site/_id.html.erb index 195873c34..7ddee6218 100644 --- a/app/views/site/_id.html.erb +++ b/app/views/site/_id.html.erb @@ -6,10 +6,12 @@ var params = {}; var mapParams = OSM.mapParams(); - if (mapParams.object && - mapParams.object.type !== 'note' && - mapParams.object.type !== 'changeset') { + 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 %>'; @@ -19,10 +21,23 @@ } var hashParams = OSM.params(location.hash.substring(1)); + if (hashParams.background) { params.background = hashParams.background; } + if (hashParams.comment) { + params.comment = hashParams.comment; + } + +<% if params[:gpx] -%> + params.gpx = '<%= trace_data_url(params[:gpx]) %>'; +<% else -%> + if (hashParams.gpx) { + params.gpx = hashParams.gpx; + } +<% end -%> + $('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>#' + querystring.stringify(params)); <% else %>