You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
It is currently impossible to handle PositionErrors occuring in the success path of the watchPosition observable. The only thing you can do is ignore them.
Expected behavior:
I expect errors to use the error path of the subscriber OR that we use a union type of Geoposition|PositionError
Related code:
this.geolocation.watchPosition({ enableHighAccuracy:false, timeout:10000, maximumAge:10000 }).subscribe( pos => {
if( ( pos as Geoposition ).coords ) {
console.log( pos );
} else {
var positionError = (pos as PositionError); //Compiling error : Type 'Geoposition' cannot be converted to type 'PositionError'. Property 'code' is missing in type 'Geoposition'.
console.log( positionError );
}
}, positionError => {
console.log( positionError );
});
Other information:
Also the documentation is outdated. You can't unsubscribe from watchPosition as observables don't have the unsubscribe method anymore. You need to use takeUntil().
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
Current behavior:
It is currently impossible to handle PositionErrors occuring in the success path of the watchPosition observable. The only thing you can do is ignore them.
Expected behavior:
I expect errors to use the error path of the subscriber OR that we use a union type of Geoposition|PositionError
Related code:
Other information:
Also the documentation is outdated. You can't unsubscribe from watchPosition as observables don't have the unsubscribe method anymore. You need to use takeUntil().
"@angular/common": "^5.0.1",
"@ionic-native/core": "^4.4.0",
"@ionic-native/geolocation": "^4.4.2"
The text was updated successfully, but these errors were encountered: