diff options
Diffstat (limited to 'public/static/js/geostop.js')
-rw-r--r-- | public/static/js/geostop.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/public/static/js/geostop.js b/public/static/js/geostop.js index 80e8311..fa2d6f1 100644 --- a/public/static/js/geostop.js +++ b/public/static/js/geostop.js @@ -42,7 +42,11 @@ $(function() { hafas = candidate.hafas; const stationlink = $(document.createElement('a')); - stationlink.attr('href', eva + '?hafas=' + hafas); + if (hafas) { + stationlink.attr('href', eva + '?hafas=' + hafas); + } else { + stationlink.attr('href', eva); + } stationlink.text(name + ' '); const distancenode = $(document.createElement('div')); @@ -61,7 +65,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); }); |