1function getReverseGeocodingData(lat, lng) {
2 var latlng = new google.maps.LatLng(lat, lng);
3 // This is making the Geocode request
4 var geocoder = new google.maps.Geocoder();
5 geocoder.geocode({ 'latLng': latlng }, (results, status) =>{
6 if (status !== google.maps.GeocoderStatus.OK) {
7 alert(status);
8 }
9 // This is checking to see if the Geoeode Status is OK before proceeding
10 if (status == google.maps.GeocoderStatus.OK) {
11 console.log(results);
12 var address = (results[0].formatted_address);
13 }
14 });
15}