mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-20 01:22:52 +08:00
docs(geolocation): add error handling and related interfaces
This commit is contained in:
parent
973c80b264
commit
010a6ea304
@ -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',
|
||||||
|
Loading…
Reference in New Issue
Block a user