npm package: @nw01/rayneo-geolocation
Description: Geolocation capabilities plugin
Author: wen01
Latest version: 0.0.92

# @nw01/rayneo-geolocation

Geolocation capabilities plugin

## Install

```bash
npm install @nw01/rayneo-geolocation
npx cap sync
```

## API

<docgen-index>

* [`getCurrentPosition(...)`](#getcurrentposition)
* [`watchPosition(...)`](#watchposition)
* [`clearWatch(...)`](#clearwatch)
* [`checkPermissions()`](#checkpermissions)
* [`requestPermissions()`](#requestpermissions)
* [Interfaces](#interfaces)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### getCurrentPosition(...)

```typescript
getCurrentPosition(options?: GeolocationOptions | undefined) => Promise<GeolocationPosition>
```

| Param         | Type                                                              |
| ------------- | ----------------------------------------------------------------- |
| **`options`** | <code><a href="#geolocationoptions">GeolocationOptions</a></code> |

**Returns:** <code>Promise&lt;<a href="#geolocationposition">GeolocationPosition</a>&gt;</code>

--------------------


### watchPosition(...)

```typescript
watchPosition(options: GeolocationOptions, callback: (position: GeolocationPosition, err?: any) => void) => Promise<PluginListenerHandle>
```

| Param          | Type                                                                                                  |
| -------------- | ----------------------------------------------------------------------------------------------------- |
| **`options`**  | <code><a href="#geolocationoptions">GeolocationOptions</a></code>                                     |
| **`callback`** | <code>(position: <a href="#geolocationposition">GeolocationPosition</a>, err?: any) =&gt; void</code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

--------------------


### clearWatch(...)

```typescript
clearWatch(options: CallbackId) => Promise<void>
```

| Param         | Type                                              |
| ------------- | ------------------------------------------------- |
| **`options`** | <code><a href="#callbackid">CallbackId</a></code> |

--------------------


### checkPermissions()

```typescript
checkPermissions() => Promise<PermissionStatus>
```

**Returns:** <code>Promise&lt;<a href="#permissionstatus">PermissionStatus</a>&gt;</code>

--------------------


### requestPermissions()

```typescript
requestPermissions() => Promise<PermissionStatus>
```

**Returns:** <code>Promise&lt;<a href="#permissionstatus">PermissionStatus</a>&gt;</code>

--------------------


### Interfaces


#### GeolocationPosition

| Prop            | Type                                                                                                                                                                                    |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`coords`**    | <code>{ latitude: number; longitude: number; accuracy: number; altitude?: number \| null; altitudeAccuracy?: number \| null; heading?: number \| null; speed?: number \| null; }</code> |
| **`timestamp`** | <code>number</code>                                                                                                                                                                     |


#### GeolocationOptions

| Prop                        | Type                 |
| --------------------------- | -------------------- |
| **`enableHighAccuracy`**    | <code>boolean</code> |
| **`timeout`**               | <code>number</code>  |
| **`maximumAge`**            | <code>number</code>  |
| **`minimumUpdateInterval`** | <code>number</code>  |


#### PluginListenerHandle

| Prop         | Type                                      |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |


#### CallbackId

| Prop     | Type                |
| -------- | ------------------- |
| **`id`** | <code>string</code> |


#### PermissionStatus

| Prop                 | Type                                           |
| -------------------- | ---------------------------------------------- |
| **`location`**       | <code>'granted' \| 'denied' \| 'prompt'</code> |
| **`coarseLocation`** | <code>'granted' \| 'denied' \| 'prompt'</code> |

</docgen-api>