Repository navigation
Refine current location until it is GPS-accurate - #139
Merged
Merged
Conversation
… rough A phone's first fix usually comes from Wi-Fi or cell towers; the GPS fix arrives seconds later. Watch the position for up to 20 s, keep the best fix, stop at 30 m or better, and never accept a cached fix. Warn when the error is more than half the chosen radius. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
'Use current location' was often rough. The app took the first fix the browser gave, and allowed a cached fix up to a minute old. On a phone that first fix usually comes from Wi-Fi or cell towers (±hundreds of m to km). The GPS fix arrives a few seconds later.
Change (
web/js/app.js,locate()):watchPositionwithenableHighAccuracy: trueandmaximumAge: 0, and keeps the best fix.Some limits remain: laptops have no GPS, and iOS blurs the location to about 1–3 km when Precise Location is off.
New behaviour, not part of the Shiny port. (The Shiny app built high-accuracy options but never passed them to
getCurrentPosition.)Tested: a Node harness that fakes
watchPosition(fix improves to GPS, stays coarse until timeout, permission denied, error after a fix, no fix at all). Not yet tried on a real phone.🤖 Generated with Claude Code