summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Model/Journeys.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-07-21 17:23:28 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-07-21 17:23:28 +0200
commitde55368db75937ac3923f149cd57d5351166fb51 (patch)
tree3b9fd62e23a4f85b4980bea0fa0e5e6a6148f3cb /lib/Travelynx/Model/Journeys.pm
parent7b1a4fc40d6e604fb1bd23251b2a5d97564d87b7 (diff)
Journey->add: store lat/lon for route at entry time, if available
Diffstat (limited to 'lib/Travelynx/Model/Journeys.pm')
-rwxr-xr-xlib/Travelynx/Model/Journeys.pm37
1 files changed, 33 insertions, 4 deletions
diff --git a/lib/Travelynx/Model/Journeys.pm b/lib/Travelynx/Model/Journeys.pm
index 424430c..8c29e7d 100755
--- a/lib/Travelynx/Model/Journeys.pm
+++ b/lib/Travelynx/Model/Journeys.pm
@@ -167,7 +167,17 @@ sub add {
my @route;
if ( not $route_has_start ) {
- push( @route, [ $dep_station->{name}, $dep_station->{eva}, {} ] );
+ push(
+ @route,
+ [
+ $dep_station->{name},
+ $dep_station->{eva},
+ {
+ lat => $dep_station->{lat},
+ lon => $dep_station->{lon},
+ }
+ ]
+ );
}
if ( $opt{route} ) {
@@ -175,8 +185,17 @@ sub add {
for my $station ( @{ $opt{route} } ) {
my $station_info = $self->{stations}->search($station);
if ($station_info) {
- push( @route,
- [ $station_info->{name}, $station_info->{eva}, {} ] );
+ push(
+ @route,
+ [
+ $station_info->{name},
+ $station_info->{eva},
+ {
+ lat => $station_info->{lat},
+ lon => $station_info->{lon},
+ }
+ ]
+ );
}
else {
push( @route, [ $station, undef, {} ] );
@@ -198,7 +217,17 @@ sub add {
}
if ( not $route_has_stop ) {
- push( @route, [ $arr_station->{name}, $arr_station->{eva}, {} ] );
+ push(
+ @route,
+ [
+ $arr_station->{name},
+ $arr_station->{eva},
+ {
+ lat => $arr_station->{lat},
+ lon => $arr_station->{lon},
+ }
+ ]
+ );
}
my $entry = {