• Returns a promise that resolves with an array containing either a GeolocationPositionError or GeolocationCoordinates.

    Returns Promise<[null | GeolocationPositionError, null | GeolocationCoordinates]>

    A Promise that resolves with an array containing either a GeolocationPositionError or GeolocationCoordinates.

    Example

    const [error, coords] = await getGeolocation();
    if (error) // handle error
    console.log(coords.latitude, coords.longitude)

Generated using TypeDoc