diff options
Diffstat (limited to 'lib/Travelynx/Controller/Traveling.pm')
-rwxr-xr-x | lib/Travelynx/Controller/Traveling.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Travelynx/Controller/Traveling.pm b/lib/Travelynx/Controller/Traveling.pm index 8f560a9..eba227f 100755 --- a/lib/Travelynx/Controller/Traveling.pm +++ b/lib/Travelynx/Controller/Traveling.pm @@ -593,12 +593,15 @@ sub geolocation { hafas => 1 } } $hafas->results; - if ( @hafas > 5 ) { - @hafas = @hafas[ 0 .. 4 ]; + if ( @hafas > 10 ) { + @hafas = @hafas[ 0 .. 9 ]; } + my @results = map { $_->[0] } + sort { $a->[1] <=> $b->[1] } + map { [ $_, $_->{distance} ] } ( @iris, @hafas ); $self->render( json => { - candidates => [ @iris, @hafas ], + candidates => [@results], } ); } |