From f6d9d738e1067397cc62485e76f2beeac85b914f Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 17 Aug 2025 10:00:37 +0200 Subject: Journey: Add JSON and GPX export of polylines --- lib/Travelynx.pm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Travelynx.pm') 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'); -- cgit v1.2.3