fix(geolocation): handle errors on watchPosition

closes #322
This commit is contained in:
Ibrahim Hadeed 2016-07-17 23:01:03 -04:00 committed by GitHub
parent 074d16605d
commit 1b161d8c9e

View File

@ -154,7 +154,7 @@ export class Geolocation {
static watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
return new Observable<Geoposition>(
(observer: any) => {
let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), options);
let watchId = navigator.geolocation.watchPosition(observer.next.bind(observer), observer.error.bind(observer), options);
return () => navigator.geolocation.clearWatch(watchId);
}
);