mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
parent
074d16605d
commit
1b161d8c9e
@ -154,7 +154,7 @@ export class Geolocation {
|
|||||||
static watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
|
static watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
|
||||||
return new Observable<Geoposition>(
|
return new Observable<Geoposition>(
|
||||||
(observer: any) => {
|
(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);
|
return () => navigator.geolocation.clearWatch(watchId);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user