diff options
Diffstat (limited to 'web/js/geolocation.js')
-rw-r--r-- | web/js/geolocation.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/web/js/geolocation.js b/web/js/geolocation.js index a5c229c19..5ff9fe9dc 100644 --- a/web/js/geolocation.js +++ b/web/js/geolocation.js @@ -31,9 +31,10 @@ fixmystreet.geolocate = function(element, success_callback) { if (!link) { return; } if ('geolocation' in navigator) { fixmystreet.geolocate(link, function(pos) { - var latitude = pos.coords.latitude; - var longitude = pos.coords.longitude; - location.href = link.href + '?latitude=' + latitude + ';longitude=' + longitude; + var latitude = pos.coords.latitude.toFixed(6); + var longitude = pos.coords.longitude.toFixed(6); + var coords = 'latitude=' + latitude + ';longitude=' + longitude; + location.href = link.href + (link.href.indexOf('?') > -1 ? ';' : '?') + coords; }); } else { link.style.display = 'none'; |