useGeolocation ​
Hook that returns the current geolocation
typescript
import { useGeolocation } from '@siberiacancode/reactuse';
Usage ​
typescript
const { loading, error, timestamp, accuracy, latitude, longitude, altitude, altitudeAccuracy, heading, speed } = useGeolocation();
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
params.enableHighAccuracy? | boolean | - | Enable high accuracy |
params.maximumAge? | number | - | Maximum age |
params.timeout? | number | - | Timeout |