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:
parent
5da273027f
commit
1eab367de5
2 changed files with 5 additions and 1 deletions
|
@ -26,9 +26,13 @@
|
||||||
params.background = hashParams.background;
|
params.background = hashParams.background;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<% if params[:gpx] -%>
|
||||||
|
params.gpx = '<%= trace_data_url(params[:gpx]) %>';
|
||||||
|
<% else -%>
|
||||||
if (hashParams.gpx) {
|
if (hashParams.gpx) {
|
||||||
params.gpx = hashParams.gpx;
|
params.gpx = hashParams.gpx;
|
||||||
}
|
}
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
$('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>#' + querystring.stringify(params));
|
$('#id-embed').attr('src', '<%= id_url :locale => params[:locale] %>#' + querystring.stringify(params));
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -194,7 +194,7 @@ OpenStreetMap::Application.routes.draw do
|
||||||
match '/traces/mine/page/:page' => 'trace#mine', :via => :get
|
match '/traces/mine/page/:page' => 'trace#mine', :via => :get
|
||||||
match '/traces/mine' => 'trace#mine', :via => :get
|
match '/traces/mine' => 'trace#mine', :via => :get
|
||||||
match '/trace/create' => 'trace#create', :via => [:get, :post]
|
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/edit' => 'trace#edit', :via => [:get, :post, :patch], :id => /\d+/, :as => "trace_edit"
|
||||||
match '/trace/:id/delete' => 'trace#delete', :via => :post, :id => /\d+/
|
match '/trace/:id/delete' => 'trace#delete', :via => :post, :id => /\d+/
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue