]> git.openstreetmap.org Git - rails.git/commitdiff
Make launching of Potlatch 2 from the GPS trace list work
authorTom Hughes <tom@compton.nu>
Tue, 30 Nov 2010 17:11:49 +0000 (17:11 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 30 Nov 2010 17:11:49 +0000 (17:11 +0000)
app/controllers/site_controller.rb
app/views/site/_potlatch2.html.erb

index 5e77b66910019eb0c5702f61cdd550d7d3a4ff7d..301d4a96641bb6d8557536c8ebf3de00baa600c1 100644 (file)
@@ -49,7 +49,8 @@ class SiteController < ApplicationController
         @zoom = params['zoom'].to_i
 
       elsif params['gpx']
-        #use gpx id to locate (dealt with below)
+        @lon = Trace.find(params['gpx']).longitude
+        @lat = Trace.find(params['gpx']).latitude
 
       elsif cookies.key?("_osm_location")
         @lon, @lat, @zoom, layers = cookies["_osm_location"].split("|")
index 57a45f2abb027216bfccab58f5de221e72cf720e..d2358f05e0afd291632060032836d8e695c17e47 100644 (file)
@@ -24,6 +24,9 @@
     fo.addParam("base","/potlatch2");
     if (lat) { fo.addVariable("lat",lat); }
     if (lon) { fo.addVariable("lon",lon); }
+    <% if params['gpx'] %>
+    fo.addVariable('gpx' ,'<%= h(params['gpx']) %>');
+    <% end %>
     fo.addVariable("zoom",zoom);
     fo.addVariable("api","http://<%= SERVER_URL %>/api/<%= API_VERSION %>/");
     fo.addVariable("policy","http://<%= SERVER_URL %>/api/crossdomain.xml");