From 241c7292e7e2a34bcb1e01483efb71a76d6bce1d Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 5 Oct 2019 13:11:24 -0400 Subject: [PATCH] increase gps accuracy second time --- views/honkpage.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/views/honkpage.js b/views/honkpage.js index 76f39af..b20972b 100644 --- a/views/honkpage.js +++ b/views/honkpage.js @@ -217,6 +217,11 @@ function updatedonker() { el.style.display = "" } var checkinprec = 500.0 +var gpsoptions = { + enableHighAccuracy: false, + timeout: 1000, + maximumAge: 0 +}; function fillcheckin() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(pos) { @@ -226,10 +231,12 @@ function fillcheckin() { el = document.getElementById("placelonginput") el.value = Math.round(pos.coords.longitude * checkinprec) / checkinprec checkinprec = 10000.0 + gpsoptions.enableHighAccuracy = true + gpsoptions.timeout = 2000 }, function(err) { showelement("placedescriptor") el = document.getElementById("placenameinput") el.value = err.message - }) + }, gpsoptions) } }