Journey->add: store lat/lon for route at entry time, if available
This commit is contained in:
parent
7b1a4fc40d
commit
de55368db7
1 changed files with 33 additions and 4 deletions
|
@ -167,7 +167,17 @@ sub add {
|
||||||
my @route;
|
my @route;
|
||||||
|
|
||||||
if ( not $route_has_start ) {
|
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} ) {
|
if ( $opt{route} ) {
|
||||||
|
@ -175,8 +185,17 @@ sub add {
|
||||||
for my $station ( @{ $opt{route} } ) {
|
for my $station ( @{ $opt{route} } ) {
|
||||||
my $station_info = $self->{stations}->search($station);
|
my $station_info = $self->{stations}->search($station);
|
||||||
if ($station_info) {
|
if ($station_info) {
|
||||||
push( @route,
|
push(
|
||||||
[ $station_info->{name}, $station_info->{eva}, {} ] );
|
@route,
|
||||||
|
[
|
||||||
|
$station_info->{name},
|
||||||
|
$station_info->{eva},
|
||||||
|
{
|
||||||
|
lat => $station_info->{lat},
|
||||||
|
lon => $station_info->{lon},
|
||||||
|
}
|
||||||
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
push( @route, [ $station, undef, {} ] );
|
push( @route, [ $station, undef, {} ] );
|
||||||
|
@ -198,7 +217,17 @@ sub add {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( not $route_has_stop ) {
|
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 = {
|
my $entry = {
|
||||||
|
|
Loading…
Reference in a new issue