LocationProvider
Finds the user's location. Nothing happens, and no permission prompt appears,
until locate or watch is called from a user action. Implementations throw
LocationError or PortAbortError.
This is an interface exported by @mapcairn/core, checked against version 0.2.0.
Signature
import type { LocationProvider } from "@mapcairn/core";
interface LocationProvider
Properties
supportsWatch
readonly supportsWatch: boolean;
Whether watch is available.
Methods
locate
locate(options?: LocateOptions): Promise<LocationFix>;
Finds the position once. Call it only from a user action, because the browser may ask for permission.
options?(LocateOptions)
watch
watch?(handlers: LocationWatchHandlers, options: {
readonly signal: AbortSignal;
}): void;
Starts watching until the signal fires. Present only when supportsWatch.
handlers(LocationWatchHandlers)options({ readonly signal: AbortSignal; })