Last active
August 29, 2015 14:07
-
-
Save junerockwell/a0b6e39d6832a36a0d8b to your computer and use it in GitHub Desktop.
Gist of code to show to Titanium JIRA
This file contains hidden or 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
Ti.Geolocation.purpose = 'Find Nearby Trails'; | |
if (Ti.Geolocation.locationServicesEnabled) { | |
if (OS_IOS) { | |
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_BEST; | |
Ti.Geolocation.activityType = Ti.Geolocation.ACTIVITYTYPE_FITNESS; | |
} else if (OS_ANDROID) { | |
Ti.Geolocation.accuracy = Ti.Geolocation.ACCURACY_HIGH; | |
} | |
Ti.Geolocation.getCurrentPosition(function(e) { | |
if (!e.error) { | |
alert("Lat: " + e.coords.latitude + ";\nlong: "+ e.coords.longitude); | |
} | |
else { | |
alert("turn on location services."); | |
} | |
} | |
else { | |
alert("Please turn on your location services."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment