Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Anderson-Juhasc/6d11e0053816ff654fbd61e595a1c2a7 to your computer and use it in GitHub Desktop.
Save Anderson-Juhasc/6d11e0053816ff654fbd61e595a1c2a7 to your computer and use it in GitHub Desktop.
function carregarLocalizacao(dest) {
navigator.geolocation.getCurrentPosition(showpos, error, options);
function showpos(position) {
var lat = position.coords.latitude
, lng = position.coords.longitude;
console.log(lat + " " + lng);
location.href = 'https://maps.google.com/maps?saddr=' + lat + ',' + lng + '&daddr=' + dest;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment