function getCountry(latLng) { geocoder.geocode( {'latLng': latLng}, function(results, status) { if(status == google.maps.GeocoderStatus.OK) { if(results[0]) { for(var i = 0; i < results[0].address_components.length; i++) { if(results[0].address_components[i].types[0] == "country") { alert(results[0].address_components[i].long_name); } } } else { alert("No results"); } } else { alert("Status: " + status); } } ); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)