summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-10-21 19:23:08 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-10-21 19:23:08 +0200
commitb4f7b2677cd4ee39846fe6f98209989824857f87 (patch)
treebf80d7ec9db880ff4226b57665749c91a3c6f568 /lib
parent12460afd1238e6d4426f731afcde14d13face8e7 (diff)
Trip->polyline: optionally fall back to beeline between stops
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Status/DE/EFA/Trip.pm6
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} // [] };
}