Saltar al contenido principal

Function: useGetGeolocation()

useGetGeolocation(options?): Promise<GeoPosition | null>

Defined in: src/infrastructure/sensors/sensors.service.ts:115

Gets the device's current geographic position once.

Parameters

options?

PositionOptions

Optional PositionOptions to override defaults.

Returns

Promise<GeoPosition | null>

A GeoPosition object or null on error / unavailability.

Example

const pos = await useGetGeolocation({ enableHighAccuracy: true });
if (pos) console.log(`${pos.lat}, ${pos.lng}`);