summaryrefslogtreecommitdiff
path: root/index.pl
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-05-11 22:54:29 +0200
committerDaniel Friesel <derf@finalrewind.org>2016-05-11 22:54:29 +0200
commitc0f9ce8253c837acbfb5c7e431f569a2dc247ab9 (patch)
tree18809da2f72a080926a678dd55497ffe86017aaf /index.pl
parent7c62efcbdce785f77f48e56ce7876a496e6cce89 (diff)
public geolocation json format
Diffstat (limited to 'index.pl')
-rw-r--r--index.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/index.pl b/index.pl
index 155fd18..e93350c 100644
--- a/index.pl
+++ b/index.pl
@@ -826,8 +826,18 @@ post '/_geolocation' => sub {
$self->render(json => {error => 'Invalid lon/lat received'});
}
else {
+ my @candidates = map {
+ {
+ ds100 => $_->[0][0],
+ name => $_->[0][1],
+ eva => $_->[0][2],
+ lon => $_->[0][3],
+ lat => $_->[0][4],
+ distance => $_->[1],
+ }
+ } Travel::Status::DE::IRIS::Stations::get_stations_by_location($lon, $lat, 10);
$self->render(json => {
- candidates => [ Travel::Status::DE::IRIS::Stations::get_stations_by_location($lon, $lat, 10) ],
+ candidates => [ @candidates ],
});
}
};