Verwendung

Request a current position

Dieser Typ wird verwendet von location.current

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>;
}

Typdeklaration

ts
export type LocationObject = Fix;

Mitglieder 3

NameTypErforderlichBeschreibung
coordsLocationCoordsJa—
timestampnumberJaMilliseconds since the epoch, when the fix was taken.
mockedbooleanJaThe fix came from the iOS simulator or an Android mock-location app.
coords — verschachtelte Felder

coords Felder

NameTypErforderlichBeschreibung
latitudenumberJa—
longitudenumberJa—
altitudenumberJaAbove sea level (iOS), or the WGS 84 ellipsoid (Android).
accuracynumberJaThe radius of 68% confidence around the position.
altitudeAccuracynumberJa—
headingnumberJaDegrees clockwise from true north that the device is moving.
speednumberJaMeters per second.
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.