Created
March 13, 2015 01:22
-
-
Save arturoleon/b1ca583f5313527bd254 to your computer and use it in GitHub Desktop.
Geolocalización con Titanium
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
// Para compatibilidad con Android en modo automático | |
Ti.Geolocation.setAccuracy(Ti.Geolocation.ACCURACY_HIGH); | |
// Obtener ubicación por única vez | |
Ti.Geolocation.getCurrentPosition(function(e){ | |
alert("obteniendo por única vez: "+ | |
e.coords.latitude+","+e.coords.longitude); | |
}); | |
// Obtener ubicación cada que cambie | |
Ti.Geolocation.addEventListener('location',function(e){ | |
console.log("obteniendo ubicación cada que cambia: "+ | |
e.coords.latitude+","+e.coords.longitude); | |
}); | |
$.index.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment