Created
April 7, 2011 02:16
-
-
Save dewski/906900 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var location; | |
var gotPosition = function (currentLocation) { | |
console.log(location.longitude); | |
// currentLocation will be the most up to date | |
// location will always have a value incase, but may not be the most up to date | |
// process with whatever you need to do, update interface, etc. | |
} | |
Titanium.Geolocation.getCurrentPosition(function(e){ | |
Ti.API.info("received geo response"); | |
if (e.error) { | |
Ti.API.info("ERROR " + e.error); | |
alert(e.error); | |
} | |
location = e.coords; | |
gotPosition(location); | |
}); | |
/* | |
So basically, all I need to do is extract the vars "longitude" and "latitude" out of this function so that I can pass it to another function. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment