location.last
The fix the platform last had, at once; null without one that meets options.
Utilização
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 fixAssinaturas
(options?: LastKnownPositionOptions): Promise<LocationObject | null>Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
options | LastKnownPositionOptions | Não | — Predefinição: {} |
Devolve
Promise<Fix>
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.