mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-21 00:23:00 +08:00
* fix #3303 geolocation watchPosition return type * watchPosition align docs
This commit is contained in:
parent
b0ffb0ec4a
commit
579170a99e
@ -192,10 +192,10 @@ export class Geolocation extends IonicNativePlugin {
|
||||
* ```
|
||||
*
|
||||
* @param {GeolocationOptions} options The [geolocation options](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions).
|
||||
* @returns {Observable<Geoposition>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
* @returns {Observable<Geoposition | PositionError>} Returns an Observable that notifies with the [position](https://developer.mozilla.org/en-US/docs/Web/API/Position) of the device, or errors.
|
||||
*/
|
||||
watchPosition(options?: GeolocationOptions): Observable<Geoposition> {
|
||||
return new Observable<Geoposition>((observer: any) => {
|
||||
watchPosition(options?: GeolocationOptions): Observable<Geoposition | PositionError> {
|
||||
return new Observable<Geoposition | PositionError>((observer: any) => {
|
||||
const watchId = navigator.geolocation.watchPosition(
|
||||
observer.next.bind(observer),
|
||||
observer.next.bind(observer),
|
||||
|
Loading…
Reference in New Issue
Block a user