Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Ti.Geolocation 'location' event sometimes tells me I've moved 200 metres when I haven't

$
0
0

This is really affecting my app logic. I'm running a simple iOS7 app on an iPhone 5. What I do is enable the 'location' event and get the user's current location.

I then use the 'location' event to see if the user has moved more than let's say 50 metres. The problem is that sometimes the location's updated coordinates tell me that I have moved 100 or 200 odd metres when I haven't really moved at all.

This happens especially when I load a MapView, or when I switch off the screen and later on resume my app.

How can I get around this?

Here is a small example of the code i'm using:

Ti.Geolocation.purpose = 'Get Current Location';
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.distanceFilter = 5;
 
Ti.Geolocation.addEventListener('location', _MaintainCurrentLocation);
 
function _MaintainCurrentLocation(e) {
    params.latitudeCurrent = e.coords.latitude;
    params.longitudeCurrent = e.coords.longitude;
 
    return true;
}

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>