Loading lib/DBInfoscreen/Controller/Stationboard.pm +13 −3 Original line number Diff line number Diff line Loading @@ -1820,12 +1820,21 @@ sub stations_by_coordinates { my $lon = $self->param('lon'); my $lat = $self->param('lat'); my $hafas = $self->param('hafas'); if ( not $lon or not $lat ) { $self->render( json => { error => 'Invalid lon/lat received' } ); return; } my $service = 'DB'; if ( $hafas and $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) ) { $service = $hafas; } $self->render_later; my @iris = map { Loading @@ -1846,6 +1855,7 @@ sub stations_by_coordinates { Travel::Status::DE::HAFAS->new_p( promise => 'Mojo::Promise', user_agent => $self->ua, service => $service, geoSearch => { lat => $lat, lon => $lon Loading @@ -1858,7 +1868,7 @@ sub stations_by_coordinates { name => $_->name, eva => $_->eva, distance => $_->distance_m / 1000, hafas => 1 hafas => $service, } } $hafas->results; if ( @hafas > 10 ) { Loading public/static/js/geostop.js +2 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,8 @@ $(function() { }; const processLocation = function(loc) { $.post('/_geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude}, processResult).fail(function(jqXHR, textStatus, errorThrown) { const param = new URLSearchParams(window.location.search); $.post('/_geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude, hafas: param.get('hafas')}, processResult).fail(function(jqXHR, textStatus, errorThrown) { removeStatus(); showError("Netzwerkfehler: ", textStatus, errorThrown); }); Loading templates/landingpage.html.ep +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ </p> % } <p class="geolink"> <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https') %>">Stationen in der Umgebung suchen</a> <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https')->query({hafas => param('hafas')}) %>">Stationen in der Umgebung suchen</a> </p> <p> Oder hier angeben: Loading templates/layouts/app.html.ep +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ Bitte eine Station aus der Liste auswählen</div> </div> % if (stash('input')) { <div class="geolink"> <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https') %>">Stationen in der Umgebung suchen</a> <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https')->query({hafas => param('hafas')}) %>">Stationen in der Umgebung suchen</a> </div> % } <div class="break"></div> Loading Loading
lib/DBInfoscreen/Controller/Stationboard.pm +13 −3 Original line number Diff line number Diff line Loading @@ -1820,12 +1820,21 @@ sub stations_by_coordinates { my $lon = $self->param('lon'); my $lat = $self->param('lat'); my $hafas = $self->param('hafas'); if ( not $lon or not $lat ) { $self->render( json => { error => 'Invalid lon/lat received' } ); return; } my $service = 'DB'; if ( $hafas and $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) ) { $service = $hafas; } $self->render_later; my @iris = map { Loading @@ -1846,6 +1855,7 @@ sub stations_by_coordinates { Travel::Status::DE::HAFAS->new_p( promise => 'Mojo::Promise', user_agent => $self->ua, service => $service, geoSearch => { lat => $lat, lon => $lon Loading @@ -1858,7 +1868,7 @@ sub stations_by_coordinates { name => $_->name, eva => $_->eva, distance => $_->distance_m / 1000, hafas => 1 hafas => $service, } } $hafas->results; if ( @hafas > 10 ) { Loading
public/static/js/geostop.js +2 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,8 @@ $(function() { }; const processLocation = function(loc) { $.post('/_geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude}, processResult).fail(function(jqXHR, textStatus, errorThrown) { const param = new URLSearchParams(window.location.search); $.post('/_geolocation', {lon: loc.coords.longitude, lat: loc.coords.latitude, hafas: param.get('hafas')}, processResult).fail(function(jqXHR, textStatus, errorThrown) { removeStatus(); showError("Netzwerkfehler: ", textStatus, errorThrown); }); Loading
templates/landingpage.html.ep +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ </p> % } <p class="geolink"> <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https') %>">Stationen in der Umgebung suchen</a> <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https')->query({hafas => param('hafas')}) %>">Stationen in der Umgebung suchen</a> </p> <p> Oder hier angeben: Loading
templates/layouts/app.html.ep +1 −1 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ Bitte eine Station aus der Liste auswählen</div> </div> % if (stash('input')) { <div class="geolink"> <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https') %>">Stationen in der Umgebung suchen</a> <a class="button" href="<%= url_for('_autostop')->to_abs->scheme('https')->query({hafas => param('hafas')}) %>">Stationen in der Umgebung suchen</a> </div> % } <div class="break"></div> Loading