I am developing a PhoneGap application with JQuery mobile which requires geolocation data. Currently the positions returned by getCurrentPosition() are very inaccurate, sometimes up to a mile away. It appears that the application is using googles location services to acquire the positions. Is there any way to force the application to use the GPS?
Also the first time a position is posted it often returns an old position (even though maximumAge is set to 0). Does anyone know why this could be?
I have read through the geolocation API below and have no been able to find anything.
A couple of things you can try is to make sure you are setting the enableHighAccuracy parameter to true in your call to getCurrentPosition.
However, most GPS chips need a bit of time before it gets you an accurate position. The better solution is to call watchPosition and wait until you get 3 to 5 results as you will find the accuracy is much better in this case. Then you can do a clearWatch and use the more accurate GPS position.