location.current
One fresh fix.
Usage
Request a current 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>;
}Signatures
(options?: LocationOptions): Promise<LocationObject>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
options | LocationOptions | No | — Default: {} |
Returns
Promise<Fix>
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.