summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Controller/Map.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-10-18 19:17:10 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-10-18 19:17:10 +0200
commit4dda0fd251e6c82c73cf7ae280caf1ae94d3012e (patch)
treef0301daaac4af07af8e5507d08cce8f1f05c0397 /lib/DBInfoscreen/Controller/Map.pm
parentd8ffb5163a0f4bf543e5b026879cfff8ada0ab52 (diff)
Add preliminary EFA support
Diffstat (limited to 'lib/DBInfoscreen/Controller/Map.pm')
-rw-r--r--lib/DBInfoscreen/Controller/Map.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/DBInfoscreen/Controller/Map.pm b/lib/DBInfoscreen/Controller/Map.pm
index f3f3f16..ba63d92 100644
--- a/lib/DBInfoscreen/Controller/Map.pm
+++ b/lib/DBInfoscreen/Controller/Map.pm
@@ -12,6 +12,7 @@ use DateTime;
use DateTime::Format::Strptime;
use GIS::Distance;
use List::Util qw();
+use Travel::Status::DE::EFA;
my $strp = DateTime::Format::Strptime->new(
pattern => '%Y-%m-%dT%H:%M:%S%z',
@@ -537,12 +538,15 @@ sub ajax_route {
sub coverage {
my ($self) = @_;
- my $backend = $self->stash('backend');
+ my $backend = lc( $self->stash('backend') );
my $service = $self->stash('service');
my $coverage = {};
- if ( $backend eq 'HAFAS' ) {
+ if ( $backend eq 'efa' ) {
+ $coverage = $self->efa->get_coverage($service);
+ }
+ elsif ( $backend eq 'hafas' ) {
$coverage = $self->hafas->get_coverage($service);
}