increase gps accuracy second time

master
Ted Unangst 5 years ago
parent 25c46f5839
commit 241c7292e7

@ -217,6 +217,11 @@ function updatedonker() {
el.style.display = "" el.style.display = ""
} }
var checkinprec = 500.0 var checkinprec = 500.0
var gpsoptions = {
enableHighAccuracy: false,
timeout: 1000,
maximumAge: 0
};
function fillcheckin() { function fillcheckin() {
if (navigator.geolocation) { if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(pos) { navigator.geolocation.getCurrentPosition(function(pos) {
@ -226,10 +231,12 @@ function fillcheckin() {
el = document.getElementById("placelonginput") el = document.getElementById("placelonginput")
el.value = Math.round(pos.coords.longitude * checkinprec) / checkinprec el.value = Math.round(pos.coords.longitude * checkinprec) / checkinprec
checkinprec = 10000.0 checkinprec = 10000.0
gpsoptions.enableHighAccuracy = true
gpsoptions.timeout = 2000
}, function(err) { }, function(err) {
showelement("placedescriptor") showelement("placedescriptor")
el = document.getElementById("placenameinput") el = document.getElementById("placenameinput")
el.value = err.message el.value = err.message
}) }, gpsoptions)
} }
} }

Loading…
Cancel
Save