location.last
The fix the platform last had, at once; null without one that meets options.
Usage
Use a recent cached position.
// Use a recent cached position.
import { location } from 'kuito';
const fix = await location.last({ maxAge: 60_000, requiredAccuracy: 100 });
if (fix) console.log(fix.coords.latitude, fix.coords.longitude); // null without a fresh enough fixSignatures
(options?: LastKnownPositionOptions): Promise<LocationObject | null>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
options | LastKnownPositionOptions | No | — Default: {} |
Returns
Promise<Fix>
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.