Loading index.pl +11 −1 Original line number Diff line number Diff line Loading @@ -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 ], }); } }; Loading public/static/geolocation.js +3 −3 Original line number Diff line number Diff line Loading @@ -18,9 +18,9 @@ $(document).ready(function() { } else { $.each(data.candidates, function(i, candidate) { var ds100 = candidate[0][0], name = candidate[0][1], distance = candidate[1]; var ds100 = candidate.ds100, name = candidate.name, distance = candidate.distance; distance = distance.toFixed(1); var stationlink = $(document.createElement('a')); Loading Loading
index.pl +11 −1 Original line number Diff line number Diff line Loading @@ -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 ], }); } }; Loading
public/static/geolocation.js +3 −3 Original line number Diff line number Diff line Loading @@ -18,9 +18,9 @@ $(document).ready(function() { } else { $.each(data.candidates, function(i, candidate) { var ds100 = candidate[0][0], name = candidate[0][1], distance = candidate[1]; var ds100 = candidate.ds100, name = candidate.name, distance = candidate.distance; distance = distance.toFixed(1); var stationlink = $(document.createElement('a')); Loading