GnssWifiLocationSource
Class: GnssWifiLocationSource
LocationSource that combines GNSS/WiFi positioning with PDR and attitude tracking
This source provides:
- GNSS/WiFi: GPS and WiFi-based positioning via AbsolutePositionProvider
- PDR: Pedestrian Dead Reckoning (integrated in AbsolutePositionProvider)
- AbsoluteAttitude: Device orientation tracking (optional)
This location source is ideal for outdoor navigation where GPS signals are available. It provides continuous position updates without requiring camera access.
Example
import { GnssWifiLocationSource } from '@wemap/positioning';
const gnssSource = new GnssWifiLocationSource({
enableAttitude: true,
usePositionSmoother: true
});
gnssSource.onUpdate((pose) => {
console.log('GPS Position:', pose.position);
});
await gnssSource.start();
Extends
Constructors
Constructor
new GnssWifiLocationSource(
config):GnssWifiLocationSource
Parameters
config
GnssWifiLocationSourceConfig = {}
Returns
GnssWifiLocationSource
Overrides
Properties
isStarted
isStarted:
boolean=false
Inherited from
Methods
offError()
offError(
callback):void
Remove the error callback
Parameters
callback
(error) => void
The callback function to remove
Returns
void
Inherited from
offUpdate()
offUpdate(
callback):void
Remove the update callback
Parameters
callback
(data) => void
The callback function to remove
Returns
void
Inherited from
onError()
onError(
callback):void
Register a callback to receive error events
Parameters
callback
(error) => void
Function to call when an error occurs
Returns
void
Inherited from
onUpdate()
onUpdate(
callback):void
Register a callback to receive pose updates
The callback receives complete pose data. If there's already a current pose available, the callback will be called immediately with that data.
Parameters
callback
(data) => void
Function to call when pose data is updated
Returns
void
Example
locationSource.onUpdate((pose) => {
console.log('Current pose:', pose);
});
Inherited from
start()
start():
Promise\<void>
Start the location source and begin emitting updates
Returns
Promise\<void>
Overrides
startAttitude()
startAttitude():
Promise\<void>
Start attitude tracking
Manually start the attitude provider if it wasn't started automatically or if it was stopped.
Returns
Promise\<void>
Example
await gnssSource.startAttitude();
stop()
stop():
Promise\<void>
Stop the location source and stop emitting updates
Returns
Promise\<void>
Overrides
stopAttitude()
stopAttitude():
Promise\<void>
Stop attitude tracking
Stop the attitude provider to save battery if attitude data is not needed.
Returns
Promise\<void>
Example
await gnssSource.stopAttitude();