Sometimes, a few kilometers away. Very frustrating!
getCurrentPosition() {
return Observable.create(observer => {
let that = this;
this._platform.ready().then(function () {
that.geolocation.getCurrentPosition({ enableHighAccuracy: true, maximumAge: 0, timeout: 30000 }).then((position) => {
observer.next(position);
observer.complete();
}).catch((error) => {
observer.error(error);
observer.complete();
console.log('Error getting location', error);
});
});
});
}