X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6494747882358cc1506ae442c89eed3db1de94a4..42c1dec8f0f53b457e9512bcc24f26cad9df9916:/app/views/site/_id.html.erb diff --git a/app/views/site/_id.html.erb b/app/views/site/_id.html.erb index 059009a0c..f88942669 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 %>'; @@ -17,10 +21,15 @@ } var hashParams = OSM.params(location.hash.substring(1)); + if (hashParams.background) { params.background = hashParams.background; } + if (hashParams.gpx) { + params.gpx = hashParams.gpx; + } + $('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>#' + querystring.stringify(params)); <% else %>