22 lines
931 B
Markdown
22 lines
931 B
Markdown
## Created with Capacitor Create App
|
|
|
|
This app was created using [`@capacitor/create-app`](https://github.com/ionic-team/create-capacitor-app),
|
|
and comes with a very minimal shell for building an app.
|
|
|
|
### Running this example
|
|
|
|
To run the provided example, you can use `npm start` command.
|
|
|
|
```bash
|
|
npm start
|
|
```
|
|
|
|
### Notes on getLatestPosition()
|
|
|
|
- The example now reflects the plugin's updated behavior: `getLatestPosition()` attempts a fresh one-shot location fix and falls back to the last cached snapshot on failure/timeout.
|
|
- The UI logs additional diagnostics:
|
|
- `_elapsedMs`: total call duration (includes waiting up to ~3000ms for a fresh fix).
|
|
- `_ageMs`: `Date.now() - timestamp` of the returned position.
|
|
- `_guessedFresh`: a simple heuristic based on the two numbers above to hint whether the result is likely fresh.
|
|
- Make sure to grant location permissions and enable location services for meaningful results.
|