Looking at the web GeoLocation API documentation there are two ways to get location - getCurrentPosition
to get a quick reading of location and watchPosition
to monitor the changes to the position.
What I'm looking for is a way to get a location reading which is quite accurate, as quickly as possible. I think the ideal would be to use an accuracy threshold on the getCurrentPosition
call - and the success handler would be called when the threshold is reached or the timeout exceeded (with as accurate as possible a result).
This doesn't already exist, right? Presumably it would be fairly straightforward to implement this by just wrapping the watchPosition
method to stop checking after a timeout or the threshold is reached. I will use this approach (and intend to post the code) if no-one is aware of a built in method to do this...