LocationCoords
A fix's position. Distances are meters; null when the platform doesn't say.
Verwendung
Request a current position
Dieser Typ wird verwendet von location.position
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
export type LocationCoords = Coords;Mitglieder 7
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
latitude | number | Ja | — |
longitude | number | Ja | — |
altitude | number | Ja | Above sea level (iOS), or the WGS 84 ellipsoid (Android). |
accuracy | number | Ja | The radius of 68% confidence around the position. |
altitudeAccuracy | number | Ja | — |
heading | number | Ja | Degrees clockwise from true north that the device is moving. |
speed | number | Ja | Meters 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.