130 lines
3.8 KiB
Markdown
130 lines
3.8 KiB
Markdown
# dumon-geolocation
|
||
|
||
Implement manager GNSS, Wi‑Fi RTT, IMU, Kalman fusion, event emitter
|
||
|
||
## Install
|
||
|
||
```bash
|
||
npm install dumon-geolocation
|
||
npx cap sync
|
||
```
|
||
|
||
## API
|
||
|
||
<docgen-index>
|
||
|
||
* [`startPositioning()`](#startpositioning)
|
||
* [`stopPositioning()`](#stoppositioning)
|
||
* [`getLatestPosition()`](#getlatestposition)
|
||
* [`addListener('onPositionUpdate', ...)`](#addlisteneronpositionupdate-)
|
||
* [Interfaces](#interfaces)
|
||
|
||
</docgen-index>
|
||
|
||
<docgen-api>
|
||
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
||
|
||
### startPositioning()
|
||
|
||
```typescript
|
||
startPositioning() => Promise<void>
|
||
```
|
||
|
||
--------------------
|
||
|
||
|
||
### stopPositioning()
|
||
|
||
```typescript
|
||
stopPositioning() => Promise<void>
|
||
```
|
||
|
||
--------------------
|
||
|
||
|
||
### getLatestPosition()
|
||
|
||
```typescript
|
||
getLatestPosition() => Promise<PositioningData>
|
||
```
|
||
|
||
**Returns:** <code>Promise<<a href="#positioningdata">PositioningData</a>></code>
|
||
|
||
--------------------
|
||
|
||
|
||
### addListener('onPositionUpdate', ...)
|
||
|
||
```typescript
|
||
addListener(eventName: 'onPositionUpdate', listenerFunc: (data: PositioningData) => void) => PluginListenerHandle
|
||
```
|
||
|
||
| Param | Type |
|
||
| ------------------ | ------------------------------------------------------------------------------ |
|
||
| **`eventName`** | <code>'onPositionUpdate'</code> |
|
||
| **`listenerFunc`** | <code>(data: <a href="#positioningdata">PositioningData</a>) => void</code> |
|
||
|
||
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
|
||
|
||
--------------------
|
||
|
||
|
||
### Interfaces
|
||
|
||
|
||
#### PositioningData
|
||
|
||
| Prop | Type |
|
||
| --------------- | ----------------------------------------------------------- |
|
||
| **`source`** | <code>'GNSS' \| 'WIFI' \| 'FUSED' \| 'MOCK'</code> |
|
||
| **`timestamp`** | <code>number</code> |
|
||
| **`latitude`** | <code>number</code> |
|
||
| **`longitude`** | <code>number</code> |
|
||
| **`accuracy`** | <code>number</code> |
|
||
| **`gnssData`** | <code><a href="#satellitestatus">SatelliteStatus</a></code> |
|
||
| **`wifiData`** | <code>WifiAp[]</code> |
|
||
| **`imuData`** | <code><a href="#imudata">ImuData</a></code> |
|
||
|
||
|
||
#### SatelliteStatus
|
||
|
||
| Prop | Type |
|
||
| ------------------------- | --------------------------------------- |
|
||
| **`satellitesInView`** | <code>number</code> |
|
||
| **`usedInFix`** | <code>number</code> |
|
||
| **`constellationCounts`** | <code>{ [key: string]: number; }</code> |
|
||
|
||
|
||
#### WifiAp
|
||
|
||
| Prop | Type |
|
||
| -------------- | ------------------- |
|
||
| **`ssid`** | <code>string</code> |
|
||
| **`bssid`** | <code>string</code> |
|
||
| **`rssi`** | <code>number</code> |
|
||
| **`distance`** | <code>number</code> |
|
||
|
||
|
||
#### ImuData
|
||
|
||
| Prop | Type |
|
||
| ------------------ | ------------------- |
|
||
| **`accelX`** | <code>number</code> |
|
||
| **`accelY`** | <code>number</code> |
|
||
| **`accelZ`** | <code>number</code> |
|
||
| **`gyroX`** | <code>number</code> |
|
||
| **`gyroY`** | <code>number</code> |
|
||
| **`gyroZ`** | <code>number</code> |
|
||
| **`speed`** | <code>number</code> |
|
||
| **`acceleration`** | <code>number</code> |
|
||
| **`directionRad`** | <code>number</code> |
|
||
|
||
|
||
#### PluginListenerHandle
|
||
|
||
| Prop | Type |
|
||
| ------------ | ----------------------------------------- |
|
||
| **`remove`** | <code>() => Promise<void></code> |
|
||
|
||
</docgen-api>
|