useGeolocation
Reactive Geolocation API. It allows the user to provide their location to web applications if they so desire. For privacy reasons, the user is asked for permission to report location information.
Package: @vueuse/core
Category: Sensors
Usage
import { useGeolocation } from '@vueuse/core'
const { coords, locatedAt, error, resume, pause } = useGeolocation()Returns
| Name | Type |
|---|---|
| isSupported | useSupported |
| coords | Ref |
| locatedAt | shallowRef<number | null> |
| error | shallowRef<GeolocationPositionError | null> |
| resume | Ref |
| pause | Ref |