Titanium.Geolocation.getCurrentPosition not working
Hi,
On trying to invoke Titanium.Geolocation.getCurrentPosition, the callback is not returning. This was working prior to 1.4 release. Has this functionality been broken?
Thanks
3 Answers
-
I'm not sure of your platform (android, iphone, etc.) so this might not apply. I was having troubles getting any sort of GPS data in the android emulator. Even the built-in maps app wouldn't show a location. I found a way to set mock coordinates that solved my issue. Maybe it will help you?
First, open ddms (Dalvik Debug Monitor). On Windows, navigate to the android-sdk\tools directory and run ddms.bat. The first line in the top-left pane will read something like "emulator-####" such as emulator-5560.
Open a command prompt window. Enter 'telnet localhost ####' substituting the number you found above. This will open a telnet window to your android emulator.
Enter the following command (substitute your own longitude & latitude, in that order, if you'd like):
geo fix -82.411629 28.054553
The GPS icon will appear in the emulator's notification bar. Geolocation is now available. At this point, I could get location data in my app and in other apps, such as Maps.
You don't have to leave the telnet session running. Closing it doesn't turn off the GPS.
I hope this helps.
Tim -
+1 - I'm having this problem too.
-
Hey, I am still having the same problem. It only happens on 3G. For some reason, the callback for getCurrentPosition does not get called at when I am on 3G, works perfectly on wifi.
Any help is greatly appreciated.