location
constlocation:object
Defined in: index.ts:17
Geolocation helpers. Browser-only: they use navigator.geolocation and navigator.permissions, so they do not
work in Node.js.
Type Declaration
Section titled “Type Declaration”getCurrent
Section titled “getCurrent”getCurrent: (
logger) =>Promise<IGeolocationCoordinates> =getCurrentLocation
Resolves the current position, or a zeroed fallback when permission is denied or the lookup fails.
Parameters
Section titled “Parameters”logger?
Section titled “logger?”LocationLogger = consoleLogger
Returns
Section titled “Returns”Promise<IGeolocationCoordinates>
Example
Section titled “Example”import { location } from "@theholocron/location-utils";
const coords = await location.getCurrent();console.log(coords.latitude, coords.longitude);