From 409576eea0542c650f3937624bb21a68ac58d6fd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 30 Nov 2010 17:11:49 +0000 Subject: [PATCH 1/1] Make launching of Potlatch 2 from the GPS trace list work --- app/controllers/site_controller.rb | 3 ++- app/views/site/_potlatch2.html.erb | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 5e77b6691..301d4a966 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -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("|") diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index 57a45f2ab..d2358f05e 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -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"); -- 2.43.2