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

Ti.Geolocation's Location event returns inconsistent coordinates

$
0
0

I have an app that needs to know the user's accurate location. It then needs to check if the user's moved more than 100 metres. This is to reload the content that the user sees in the mobile app.

What I do on load of the mobile app, is switch on the Ti.Geolocation 'location' event. I want to get the user's precise location, whether in the building or outside. I launch a MapView and place an annotation of the user's current location when the MapView was loaded. I use Ti.MAP for this.

The annotation on the Map is off by 20-30 metres. Here's the concerning part. If the UserLocation Property of the MapView is set to True, then the Blue icon will load where my user's annotation is positioned, but after a few seconds the blue icon moves to the user's actual location, leaving the annotation pin where it was.

How do I get that same result for for my user's actual location? How do I get the user's annotation pin also be correctly positioned? What does the blue icon on the MapView do that I cannot achieve in my code?

BTW the code I'm using for all of this is very standard:

Ti.Geolocation.purpose = 'Get Current Location';
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST;
Ti.Geolocation.addEventListener('location', _StartCurrentLocation);
 
function _StartCurrentLocation(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>