I have below code to find user current location.
if (navigator.geolocation) {
// Get current position
navigator.geolocation.getCurrentPosition(function (position) {
myLatLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
alert(myLatLng);
},
function () {
alert('fallback');
});
}
Above code works fine but it prompts the user asking 'would you like to share your location with www.something.com?'. Now if user does not want to share his location then I need to show some alert. How can I do that?