Instruct iD to load gpx file

When one clicks on the edit link of an uploaded GPX file, this instructs
the iD editor to load the respective GPX data from the appropriate URL.

See https://github.com/openstreetmap/iD/issues/970#issuecomment-43439476.
This commit is contained in:
Martin Raifer 2014-05-18 17:07:31 +02:00 committed by Tom Hughes
parent 5da273027f
commit 1eab367de5
2 changed files with 5 additions and 1 deletions

View file

@ -26,9 +26,13 @@
params.background = hashParams.background;
}
<% 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));
</script>

View file

@ -194,7 +194,7 @@ OpenStreetMap::Application.routes.draw do
match '/traces/mine/page/:page' => 'trace#mine', :via => :get
match '/traces/mine' => 'trace#mine', :via => :get
match '/trace/create' => 'trace#create', :via => [:get, :post]
match '/trace/:id/data' => 'trace#data', :via => :get, :id => /\d+/
match '/trace/:id/data' => 'trace#data', :via => :get, :id => /\d+/, :as => "trace_data"
match '/trace/:id/edit' => 'trace#edit', :via => [:get, :post, :patch], :id => /\d+/, :as => "trace_edit"
match '/trace/:id/delete' => 'trace#delete', :via => :post, :id => /\d+/