From b4f7b2677cd4ee39846fe6f98209989824857f87 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 21 Oct 2024 19:23:08 +0200 Subject: Trip->polyline: optionally fall back to beeline between stops --- lib/Travel/Status/DE/EFA/Trip.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/Travel') 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} // [] }; } -- cgit v1.2.3