Skip to content

Last known location on the web #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
michalgwo opened this issue May 14, 2025 · 2 comments
Open

Last known location on the web #212

michalgwo opened this issue May 14, 2025 · 2 comments

Comments

@michalgwo
Copy link
Contributor

lastLocation() on the web was temporarily implemented here #211 by getting current location. Ideally, it should get the last known location, like Android and iOS.

@jordond
Copy link
Owner

jordond commented May 16, 2025

Preface this with the fact that I'm not a web developer by any means. But It sounds like the current API being used might be the right approach.

Setting the maximumAge might be what we want to add:

A positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. If set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. If set to Infinity the device must return a cached position regardless of its age. Default: 0.

And possibly use a short timeout interval so that it will return early if no location exists.

@michalgwo
Copy link
Contributor Author

I'm not a web developer either, just a name of the function on the web didn't sound to me like it gets the last location, but if you think it's the right approach, feel free to close the issue.

I wouldn't set the maximumAge here, as by definition, the last location can be stale, and that's okay, it's the user's responsibility to take care of it, as we have a timestamp with every location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants