mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-04 00:13:06 +08:00
docs(geolocation): fix reference (#1217)
This commit is contained in:
parent
602f14771c
commit
7b069a3e58
@ -122,15 +122,20 @@ export interface GeolocationOptions {
|
|||||||
* ```typescript
|
* ```typescript
|
||||||
* import { Geolocation } from '@ionic-native/geolocation';
|
* import { Geolocation } from '@ionic-native/geolocation';
|
||||||
*
|
*
|
||||||
|
* ...
|
||||||
*
|
*
|
||||||
* Geolocation.getCurrentPosition().then((resp) => {
|
* constructor(private geolocation: Geolocation) {}
|
||||||
|
*
|
||||||
|
* ...
|
||||||
|
*
|
||||||
|
* this.geolocation.getCurrentPosition().then((resp) => {
|
||||||
* // resp.coords.latitude
|
* // resp.coords.latitude
|
||||||
* // resp.coords.longitude
|
* // resp.coords.longitude
|
||||||
* }).catch((error) => {
|
* }).catch((error) => {
|
||||||
* console.log('Error getting location', error);
|
* console.log('Error getting location', error);
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* let watch = Geolocation.watchPosition();
|
* let watch = this.geolocation.watchPosition();
|
||||||
* watch.subscribe((data) => {
|
* watch.subscribe((data) => {
|
||||||
* // data can be a set of coordinates, or an error (if an error occurred).
|
* // data can be a set of coordinates, or an error (if an error occurred).
|
||||||
* // data.coords.latitude
|
* // data.coords.latitude
|
||||||
|
Loading…
Reference in New Issue
Block a user