Function: useWatchGeolocation()
useWatchGeolocation(
callback,options?): (() =>void) |null
Defined in: src/infrastructure/sensors/sensors.service.ts:152
Continuously watches the device's geographic position.
Parameters
callback
(position) => void
Called with a GeoPosition on each position update.
options?
PositionOptions
Optional PositionOptions to override defaults.
Returns
(() => void) | null
A cleanup function that stops watching, or null if unavailable.
Example
const stop = useWatchGeolocation((pos) => {
console.log("Moved to", pos.lat, pos.lng);
});
// later:
stop?.();