diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-08-17 10:00:37 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-08-17 10:00:37 +0200 |
commit | f6d9d738e1067397cc62485e76f2beeac85b914f (patch) | |
tree | a20cd096e38df2b7f12c02158dfd701d94b9dfa1 /lib/Travelynx.pm | |
parent | e97f7892a6d1a74e729dc676fb90db8afc408db5 (diff) |
Journey: Add JSON and GPX export of polylines
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-x | lib/Travelynx.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 607b153..586f1a0 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -69,6 +69,8 @@ sub startup { $self->types->type( csv => 'text/csv; charset=utf-8' ); $self->types->type( json => 'application/json; charset=utf-8' ); + $self->types->type( gpx => 'application/gpx+xml; charset=utf-8' ); + $self->types->type( xml => 'text/xml; charset=utf-8' ); $self->plugin('Config'); @@ -3174,6 +3176,11 @@ sub startup { $authed_r->get( '/journey/:id' => [ format => [ 'html', 'json' ] ] ) ->to( 'traveling#journey_details', format => undef ) ->name('journey'); + $authed_r->get( '/polyline/:id' => [ format => [ 'gpx', 'json' ] ] )->to( + 'traveling#journey_details', + format => undef, + polyline_export => 1 + )->name('polyline_download'); $authed_r->get('/s/*station')->to('traveling#station'); $authed_r->get('/confirm_mail/:token')->to('account#confirm_mail'); $authed_r->post('/account/privacy')->to('account#privacy'); |