summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Controller
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-01-08 21:27:32 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-01-08 21:27:32 +0100
commit240976e8056624ee93f858829b75e33993561c24 (patch)
treefd032ce45ef20187be2ee5023b0aa965365e8102 /lib/DBInfoscreen/Controller
parent8af56f340b6af2684fe4365bc33b478e56654a2b (diff)
show station location in map2.5.9
Diffstat (limited to 'lib/DBInfoscreen/Controller')
-rw-r--r--lib/DBInfoscreen/Controller/Map.pm26
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm1
2 files changed, 27 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Controller/Map.pm b/lib/DBInfoscreen/Controller/Map.pm
index 70b2644..6ab2c32 100644
--- a/lib/DBInfoscreen/Controller/Map.pm
+++ b/lib/DBInfoscreen/Controller/Map.pm
@@ -68,6 +68,9 @@ sub route {
my $trip_id = $self->stash('tripid');
my $line_no = $self->stash('lineno');
+ my $from_name = $self->param('from');
+ my $to_name = $self->param('to');
+
$self->render_later;
$self->get_hafas_polyline_p( $trip_id, $line_no )->then(
@@ -102,6 +105,29 @@ sub route {
my @stop_lines = ( $stop->{stop}{name} );
my ( $platform, $arr, $dep, $arr_delay, $dep_delay );
+ if ( $from_name and $stop->{stop}{name} eq $from_name ) {
+ push(
+ @markers,
+ {
+ lon => $stop->{stop}{location}{longitude},
+ lat => $stop->{stop}{location}{latitude},
+ title => $stop->{stop}{name},
+ icon => 'greenIcon',
+ }
+ );
+ }
+ if ( $to_name and $stop->{stop}{name} eq $to_name ) {
+ push(
+ @markers,
+ {
+ lon => $stop->{stop}{location}{longitude},
+ lat => $stop->{stop}{location}{latitude},
+ title => $stop->{stop}{name},
+ icon => 'goldIcon',
+ }
+ );
+ }
+
if ( $stop->{arrival}
and $arr = $strp->parse_datetime( $stop->{arrival} ) )
{
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 797cde9..59ee48d 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -1273,6 +1273,7 @@ sub handle_request {
linetype => $linetype,
icetype => $self->app->ice_type_map->{ $departure->{train_no} },
dt_now => DateTime->now( time_zone => 'Europe/Berlin' ),
+ station_name => $data->{station_name} // $station,
);
}
else {