capacitor-location
v0.0.4
Published
Plugin to request permission and get address by coordinates
Readme
capacitor-location
Plugin to request permission and get address by coordinates
Install
npm install capacitor-location
npx cap syncAPI
echo(...)checkPermission()requestPermission()checkRequestPermission()getCurrentPosition()getAddress(...)getCurrentAddress()- Interfaces
- Type Aliases
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>| Param | Type |
| ------------- | ------------------------------- |
| options | { value: string; } |
Returns: Promise<{ value: string; }>
checkPermission()
checkPermission() => Promise<PermissionResult>Returns: Promise<PermissionResult>
requestPermission()
requestPermission() => Promise<PermissionResult>Returns: Promise<PermissionResult>
checkRequestPermission()
checkRequestPermission() => Promise<PermissionResult>Returns: Promise<PermissionResult>
getCurrentPosition()
getCurrentPosition() => Promise<LocationResult>Returns: Promise<LocationResult>
getAddress(...)
getAddress(options: { latitude: number; longitude: number; }) => Promise<AddressResult>| Param | Type |
| ------------- | ----------------------------------------------------- |
| options | { latitude: number; longitude: number; } |
Returns: Promise<AddressResult>
getCurrentAddress()
getCurrentAddress() => Promise<CurrentAddressResult>Returns: Promise<CurrentAddressResult>
Interfaces
PermissionResult
| Prop | Type |
| ------------------ | --------------------------------------------------------- |
| Granted | boolean |
| Status | LocationStatus |
| ErrorMessage | string |
LocationResult
| Prop | Type |
| ------------- | ----------------------------------------------------------- |
| Details | LocationDetails |
LocationDetails
| Prop | Type |
| --------------- | ------------------- |
| latitude | number |
| longitude | number |
| accuracy | number |
AddressResult
| Prop | Type |
| ------------- | --------------------------------------------------------- |
| Details | AddressDetails |
AddressDetails
| Prop | Type |
| ----------------- | ------------------- |
| street | string |
| number | string |
| city | string |
| state | string |
| country | string |
| postalCode | string |
| fullAddress | string |
CurrentAddressResult
| Prop | Type |
| ------------- | ----------------------------------------------------------------------- |
| Details | CurrentAddressDetails |
CurrentAddressDetails
| Prop | Type |
| ------------- | --------------------------------------------------------- |
| address | AddressDetails |
Type Aliases
LocationStatus
'granted' | 'denied' | 'prompt' | 'error'
