From 010a6ea304c8c128287cf82bc5aefb7760f09ff6 Mon Sep 17 00:00:00 2001 From: Ibby Date: Tue, 4 Oct 2016 13:45:54 -0400 Subject: [PATCH] docs(geolocation): add error handling and related interfaces --- src/plugins/geolocation.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/geolocation.ts b/src/plugins/geolocation.ts index 289a1caec..b2f15ef93 100644 --- a/src/plugins/geolocation.ts +++ b/src/plugins/geolocation.ts @@ -121,14 +121,22 @@ export interface GeolocationOptions { * Geolocation.getCurrentPosition().then((resp) => { * // resp.coords.latitude * // resp.coords.longitude - * }) + * }).catch((error) => { + * console.log('Error getting location', error); + * }); * * let watch = Geolocation.watchPosition(); * watch.subscribe((data) => { + * // data can be a set of coordinates, or an error (if an error occurred). * // data.coords.latitude * // data.coords.longitude - * }) + * }); * ``` + * @interfaces + * Coordinates + * Geoposition + * PositionError + * GeolocationOptions */ @Plugin({ plugin: 'cordova-plugin-geolocation',