Created
July 18, 2012 19:16
-
-
Save siddharta1337/3138211 to your computer and use it in GitHub Desktop.
Prueba GPS
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ejercicio GPS</title> | |
<meta charset="utf-8"> | |
<script type="text/javascript" charset="utf-8"> | |
var lectura | |
function mostrarPosicion(){ | |
navigator.geolocation.getCurrentPosition(lecturaExitosa, error , {enableHighAccuracy: true } ); | |
} | |
function lecturaExitosa(posicion) { | |
alert(' tu posicion es: Latitud ' + posicion.coords.latitude+'\n' + 'Longitud '+ posicion.coords.longitude ) | |
} | |
function error(){ | |
alert('no se donde estas'); | |
} | |
// Cordova esta disponible! | |
// | |
function onDeviceReady() { | |
alert("listo") | |
} | |
</script> | |
</head> | |
<body> | |
<h1>Ubicacion del dispositivo</h1> | |
<div id="resultados"></div> | |
<button onclick="mostrarPosicion();">Mostrar Posicion</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment