Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

accuracy of Ti.Geolocation.getCurrentPosition?

for some reason, no matter where I go, when I get my current position and map it, I appear to be a few miles off of where I really am. Somehow, though, the 'blue dot' shows up at my true location.

What gives? Is there some fancy math I need to do to the coordinates returned from getCurrentLocation?

The code I'm using is basically exactly the same as that in the geolocation sample from KitchenSink

— asked April 3rd 2010 by Mark Harris
  • getcurrentlocation
  • gps
  • map

3 Answers

  • not exctly an answer to your question, but it seems to me that getting the position once with Ti.Geolocation.getCurrentPosition() uses values from a cache. on my phone, it doesn't switch on the GPS, i have to add a location listener, which gives higher precision quickly.
    on the other hand, when using only the listener without the getCurrentPosition(), it doesn't add the location capabilities to the app at all. so, you'll have to do it like in the kitchen sink examples. maybe that's phone dependand, don't know.

    — answered April 3rd 2010 by u no
  • getCurrentPosition()'s requirement is to not turn on the radios, so it's the last known location.

    — answered April 3rd 2010 by Don Thorp
    1 Comment
    • surely that defeats the naming of this function? should be named getLastKnownPosition() ?

      — commented July 3rd 2010 by Chris Johnson
  • yea, ive noticed this as well.

    — answered July 3rd 2010 by Chris Johnson
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.