16

Just a quick question I have built the following code:

http://letterpool.testmode.co.uk/map.html

However with some users I am getting reports that people are getting around a 200-300 meter of their actual location.

Does any one know why ?

3
  • 2
    What location source do those users have on their devices - GPS, wifi, geo-IP only? Do they have other apps that are more accurate, or is it simply that's the best guess you can get?
    – Rup
    Commented Aug 2, 2010 at 14:53
  • I have tried in a office, tried via 3g on my iphone other people have tried on other devices. Commented Aug 2, 2010 at 14:54
  • 2
    NOTE: alert("Sorry but we cannot get your location because your offline"); should be "you're" or "you are" ;) Commented Apr 3, 2012 at 1:26

3 Answers 3

26

The W3C Geolocation API, which you're using to locate users on the test map, is intentionally agnostic to the method the browser uses to locate the device. This is a useful convenience since devices vary widely on how they locate (GPS, WiFi triangulation, cell tower triangulation, IP geolocation, manual entry, etc.) and your website probably doesn't want to deal with all of those details.

However, if you're not happy with the accuracy, there are a few options you can take advantage of that may help. The enableHighAccuracy option will hint to the device that it should prefer to use up a little more power in order to get a more precise location. You're currently using the latitude and longitude of the return value, but the API also returns an accuracy value, so you can see whether the position you're receiving is precise or not. You could also use watchPosition which will continually update the location and may eventually get a precise enough fix for your purposes (most mobile devices tend to start with low accuracy and get more refined over a few seconds or minutes).

1
  • 2
    Also useful to note that this is a very new technology (still) and support across browsers is not uniform. A current browser on a mobile device or a laptop will likely give you accurate results. A device connected via ethernet will only give you a result as accurate as the IP address can reveal, which may not be very accurate at all.
    – Thor
    Commented Jan 14, 2012 at 23:46
7

Because geo-location is not accurate and never has been. They are probably getting the location of the closest junction box.

With me, it found the data center where my ISP operates from - miles away.

See this article.

3
  • What would you say is more accurate ? Commented Aug 2, 2010 at 14:53
  • 3
    @Oliver Bayes-Shelton - GPS, wifi/cellphone triangulation would all be more accurate, but not perfect. And they all require dedicated hardware and possibly consent of user.
    – Oded
    Commented Aug 2, 2010 at 14:56
  • 1
    I have similar problem, as stated in stackoverflow.com/questions/8257160/… but my browser receive geolocation much less precise than native app, so it's not a problem with gps precision itself Commented Nov 24, 2011 at 13:58
4

Geolocation of course depends on the available position measurement methods. If the browser only has the IP address then it will be very inaccurate, but if it has access to a a GPS device like in a smartphone it will be pretty good.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.