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?