X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/0d3a9ed9cb47ce3b89ea9eaffbb589f9a9ff6d22..74543b630eaff87f9c7013a933927fa8785e6497:/app/views/site/_potlatch2.html.erb diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index 4559282ca..31e15f09d 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -69,8 +69,12 @@ <% elsif params[:way] -%> <% bbox = Way.find(params[:way]).bbox.to_unscaled -%> doSWF(<%= bbox.centre_lat %>,<%= bbox.centre_lon %>,16); + <% elsif params[:gpx] -%> + <% trace = Trace.find(params[:gpx]) -%> + doSWF(<%= trace.latitude %>,<%= trace.longitude %>,16); <% else -%> - doSWF(<%= @lat || 'null' %>,<%= @lon || 'null' %>,<%= @zoom %>); + var params = OSM.mapParams(); + doSWF(params.lat, params.lon, params.zoom || 17); <% end -%> $(document).ready(function () {