Utilização

Request a current position

Este tipo é usado por location.watch

tsx
import { Text, location, permissions } from 'kuito';

const { status } = await permissions.request('location');

if (status === 'granted') {
  const here = await location.current({ accuracy: 'high' });
  const [place] = await location.reverseGeocode(here.coords);
}

function Here() {
  // Locates while Here is mounted; the fixes land in location.position.
  location.watch({ distanceInterval: 20 });

  return <Text>{`${location.position.value?.coords.latitude ?? '…'}`}</Text>;
}

Declaração do tipo

ts
export type WatchPositionOptions = LocationOptions & {
  /** Milliseconds between updates, at least. Android only; iOS delivers as fixes come. */
  timeInterval?: number;
  /** Meters the device moves before the next update. */
  distanceInterval?: number;
};

Membros 3

NomeTipoObrigatórioDescrição
accuracyAccuracyNão—
timeIntervalnumberNãoMilliseconds between updates, at least. Android only; iOS delivers as fixes come.
distanceIntervalnumberNãoMeters the device moves before the next update.
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.