I all, I have a problem, in my bq aquarius 5hd, navigator.geolocation.getCurrentPosition work, but in my kurio no (Error(3): Timeout expired) please help me
(it is my code)
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
function success(pos) {
var crd = pos.coords;
alert('Your current position is:');
alert('Latitude : ' + crd.latitude);
alert('Longitude: ' + crd.longitude);
alert('More or less ' + crd.accuracy + ' meters.');
};
function error(err) {
alert('ERROR(' + err.code + '): ' + err.message);
};
navigator.geolocation.getCurrentPosition(success, error, options);
})
If youāre not using the Cordova geolocation plugin but relying on the built in geolocation functions of the browser, it could be your older device is failing because that version of the browser doesnāt support geolocation? This is just a guess.
If this is the case, I would try the plugin and see if that resolves your issue.
Thanks @coen_warmer for the help, but Iām using the plugin above, already uninstalled it up and went back to install to have for certain that the latest version was the same but the error continues
No matter what the timeout is set or whether the high accuracy is true or false !!
$cordovageolocation always returning error code 3 error message Timeout expired
$cordovaGeolocation.getCurrentPosition(posOptions).then(function (position) {
var lat = position.coords.latitude;
var long = position.coords.longitude;
//alert(lat);
var FormData = {
'radius' : $localStorage.nearradius,
'latitude' : lat,
'longitude' : long
};
$http({
method: 'POST',
url: 'http://xyz.com/abc',
data: FormData,
headers: {'Content-Type': 'application/x-www-form-urlencoded','Authorization':undefined},
})
.success(function(data) {
Using the plugin, as @Sumeet123, get error: error code 3 error message Timeout expired
Using navigator.geolocation like:
if (navigator.geolocation) {
console.log(āgeolocationā);
navigator.geolocation.getCurrentPosition(function(position) {
console.log('navigator ok);
var lat = position.coords.latitude;
var lng = position.coords.longitude;
Show āgeolocationā in console. But nothing more, or ānavigator okā, ānavigator errorā or some other error. In app android and emulator, with ionic last version. Iām making some mistake? Any alternative for current position?
hi,
i set watcher and the water is triggering very frequently, even if i didnt move the device.
the difference bettween the prev location and the current location is in meters.
how to eliminate the error redings from the watcher?