diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-21 19:23:08 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-21 19:23:08 +0200 |
commit | b4f7b2677cd4ee39846fe6f98209989824857f87 (patch) | |
tree | bf80d7ec9db880ff4226b57665749c91a3c6f568 /lib/Travel/Status/DE/EFA/Trip.pm | |
parent | 12460afd1238e6d4426f731afcde14d13face8e7 (diff) |
Trip->polyline: optionally fall back to beeline between stops
Diffstat (limited to 'lib/Travel/Status/DE/EFA/Trip.pm')
-rw-r--r-- | lib/Travel/Status/DE/EFA/Trip.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/EFA/Trip.pm b/lib/Travel/Status/DE/EFA/Trip.pm index 658dffe..4c495dd 100644 --- a/lib/Travel/Status/DE/EFA/Trip.pm +++ b/lib/Travel/Status/DE/EFA/Trip.pm @@ -46,7 +46,11 @@ sub new { } sub polyline { - my ($self) = @_; + my ( $self, %opt ) = @_; + + if ( $opt{fallback} and not @{ $self->{polyline} // [] } ) { + return map { $_->{latlon} } $self->route; + } return @{ $self->{polyline} // [] }; } |