I'm using ngCordova in an Ionic project and the geolocation watchPosition method is behaving stragely.
I have a factory which returns a promise:
var watchOptions = {
frequency: 5000,
timeout: 7000,
maximumAge: 100,
enableHighAccuracy: false
};
var watch = $cordovaGeolocation.watchPosition(watchOptions);
return watch;
I'm using the data returned from the promise in a controller:
GetCurrentLocation.then(null, function(err) {
console.log(err);
}, function(position) {
console.log(position);
});
When the state changes to the page using this controller it logs the position once, but then not again after that. Actually, sometime it will randomly log it again. I'm not sure if the position has to move a certain amount for it to update the position or if I'm doing something wrong here.