geolocationSupported();
function geolocationSupported() {
if (navigator.geolocation) {
console.log("Geolocation is supported by this browser :)");
getCurrentLocation();
} else {
console.log("Geolocation is NOT supported by this browser :(");
}
}
function getCurrentLocation() {
navigator.geolocation.getCurrentPosition(function(result) {
result.coords.latitude; // latitude value
result.coords.longitude; // longitude value
});
}