docs(geolocation): add error handling and related interfaces

This commit is contained in:
Ibby 2016-10-04 13:45:54 -04:00
parent 973c80b264
commit 010a6ea304

View File

@ -121,14 +121,22 @@ export interface GeolocationOptions {
* Geolocation.getCurrentPosition().then((resp) => { * Geolocation.getCurrentPosition().then((resp) => {
* // resp.coords.latitude * // resp.coords.latitude
* // resp.coords.longitude * // resp.coords.longitude
* }) * }).catch((error) => {
* console.log('Error getting location', error);
* });
* *
* let watch = Geolocation.watchPosition(); * let watch = Geolocation.watchPosition();
* watch.subscribe((data) => { * watch.subscribe((data) => {
* // data can be a set of coordinates, or an error (if an error occurred).
* // data.coords.latitude * // data.coords.latitude
* // data.coords.longitude * // data.coords.longitude
* }) * });
* ``` * ```
* @interfaces
* Coordinates
* Geoposition
* PositionError
* GeolocationOptions
*/ */
@Plugin({ @Plugin({
plugin: 'cordova-plugin-geolocation', plugin: 'cordova-plugin-geolocation',