Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Most accurate gps location of a mobile device

I'm building a web-based registration-system for mobile devices. It is very important to get the most accurate gps location (latitude / longitude). HTML5 navigator is not very accurate and doesn't even use the GPS as var as I can see. Google gears is a bit better but still has more than a kilometer deviation or has the habit to get the coordinates of the closest road.

Can someone give me tips on how to gain most accurate gps location of a mobile device with JavaScript or such?

like image 607
Ronald J. de Vries Avatar asked Nov 12 '22 22:11

Ronald J. de Vries


1 Answers

There is no way to force the API to use a specific location method. They are a level above the "hardware" control. As far as I know, all of them just try to get the most precise/up to date data, but without any guarantee what will they use. You can use the enableHighAccuracy option with the Geolocation API, but that does not explicitly mean that it will use GPS. The documentation suggests that it will try it first.

From the documentation:

The enableHighAccuracy attribute provides a hint that the application would like to receive the best possible results. This may result in slower response times or increased power consumption. The user might also deny this capability, or the device might not be able to provide more accurate results than if the flag wasn't specified. The intended purpose of this attribute is to allow applications to inform the implementation that they do not require high accuracy geolocation fixes and, therefore, the implementation can avoid using geolocation providers that consume a significant amount of power (e.g. GPS). This is especially useful for applications running on battery-powered devices, such as mobile phones.

http://dev.w3.org/geo/api/spec-source.html

P.S Avoid Google Gears, since it is on EOL status.

like image 82
Aleksandar Stojadinovic Avatar answered Nov 15 '22 11:11

Aleksandar Stojadinovic