When i started
window.onload = function () { document.addEventListener("deviceready", getGeolocation); } function getGeolocation() { navigator.geolocation.getCurrentPosition( successCallback, errorCallback, {maximumAge: 0}); }
or
function getGeolocation() { watchGeoMarkerProcess = navigator.geolocation.watchPosition(updateCallback, errorCallback); }
and then
function updateCallback(position) { if (position.coords.accuracy < 100) { navigator.geolocation.clearWatch(watchGeoMarkerProcess); } }
in my application on iOS 5 using phonegap it seems to be stuck because the geolocation indicator icon remains in the top bar and it never disappears, which I mean that the GPS does not turn off. Also, sometimes I donβt get any coordinates at all, throwing a timeout error.
I donβt think that something is wrong with the code, since it works fine as a webapp.
Any ideas?
jenswirf
source share