Hallo,
wie lange braucht ein Android-Smartphone, um GPS Daten für den Browser bereitzustellen? Ich gehe aus dem Büro nach draussen, rufe meine Seite auf, das GPS-Symbol blinkt und dann kommt die Meldung:
"ERROR(3) GPS timeout 20 sec"
Mein Code:
var options = {
enableHighAccuracy: true,
timeout: 20000,
maximumAge: 0
};
function success(pos) {
var crd = pos.coords;
console.log('Your current position is:');
console.log('Latitude : ' + crd.latitude);
console.log('Longitude: ' + crd.longitude);
console.log('More or less ' + crd.accuracy + ' meters.');
//window.location.href = "http://[HOST]/?zp=p591a&GPS=" +ord.latitude +"," +ord.longitude;
};
function error(err) {
//console.warn('ERROR(' + err.code + '): ' + err.message);
var message;
if ( err.code == 1 ) { message = "GPS permission denied"; }
else if ( err.code == 2 ) { message = "GPS position unavailable"; }
else if ( err.code == 3 ) { message = "GPS timeout 20 sec"; }
alert( 'ERROR(' + err.code + '): ' + message );
};
function getCurrentPosition()
{
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(success, error, options);
}
}
Ich habe keine andere Anwendung mit GPS, möglicherweise gibt eine Schraube anderswo im LG-Smartphone, an der ich schrauben muss?