Created
November 27, 2018 10:13
-
-
Save RomainMaillot13/50d276cfb5e2d1a0bbeec8829f0fabde to your computer and use it in GitHub Desktop.
get location
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
<script> | |
function maPosition(position) { | |
var infopos = "Position déterminée :\n"; | |
infopos += "Latitude : "+position.coords.latitude +"\n"; | |
infopos += "Longitude: "+position.coords.longitude+"\n"; | |
infopos += "Altitude : "+position.coords.altitude +"\n"; | |
document.getElementById("infoposition").innerHTML = infopos; | |
} | |
if(navigator.geolocation) | |
navigator.geolocation.getCurrentPosition(maPosition); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment