Is it possible to determine wether navigator.geolocation coords are from a GPS or generated some other way?
Is it possible to determine wether navigator.geolocation coords are from a GPS or generated
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No.
However, you could check the
.coords.accuracyattribute to find out if it’s likely to be GPS or something else (like nearby WLANs).Edit: According to https://developer.mozilla.org/en/Using_geolocation at least Firefox does not provide this attribute. So in this case you are out of luck.Edit 2: According to the firebug console the attribute is actually available. On my work PC which does not have wireless, it’s
25000for example.So the value makes sense, when testing on Google maps the position in my case was not very accurate.
Conclusion:
If finding out if the location is accurate or not is sufficient for you, go with accuracy. Otherwise you are out of luck.