Hi Thoem, What about clearing watchID first then put another watchPosition event on it? Seems like there is 2, 3, 4, 5 watchPosition event in watchID listener and you just delete the first one when using clearWatch...
See sample code here http://remi-grumeau.com/test/geolocation/watchPosition.html Remi On Fri, Dec 9, 2011 at 09:17, Thoern <[email protected]> wrote: > Funny thing, after upgradeing to ios 5 and its new version of Safari I > can not shut of the geolocation, it continues to track the position > after turning it of, any ideas? It worked fine in previous versions of > safari/ios. > I have a checkbox that one can turn of the geolocation...code below : > > > > > Starting geolocation > if (navigator.geolocation) { > watchID = navigator.geolocation.watchPosition(foundLocation, > geo_error, { enableHighAccuracy: true, maximumAge: 30000, timeout: > 27000 }); > > } else { bla bla bla... > > > > > > Shuting of code > > function clearWatch(watchID) { > if (document.lagerform.chkgps.checked == false) { > window.navigator.geolocation.clearWatch(watchID); > > } > else { > watchID = > navigator.geolocation.watchPosition(foundLocation, geo_error, > { enableHighAccuracy: true, maximumAge: 30000, timeout: 27000 }); > > } > } > > -- > You received this message because you are subscribed to the Google Groups > "iPhoneWebDev" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/iphonewebdev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
