location.LocationCoords
A fix's position. Distances are meters; null when the platform doesn't say.
Utilização
Request a current position
Este tipo é usado por 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>;
}Declaração do tipo
export type LocationCoords = Coords;Membros 7
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
latitude | number | Sim | — |
longitude | number | Sim | — |
altitude | number | Sim | Above sea level (iOS), or the WGS 84 ellipsoid (Android). |
accuracy | number | Sim | The radius of 68% confidence around the position. |
altitudeAccuracy | number | Sim | — |
heading | number | Sim | Degrees clockwise from true north that the device is moving. |
speed | number | Sim | Meters per second. |
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.