Getting Address for latitude and longitude are to easy with Google Map Javascript API.
following are few line javascript code that return Address for Latitude 21.211259 Longitude 72.850255
following are few line javascript code that return Address for Latitude 21.211259 Longitude 72.850255
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder = new google.maps.Geocoder();
var lat = 21.211259534310496;
var long = 72.85025596618652;
var latLng = new google.maps.LatLng(lat, long);
geocoder.geocode({ latLng: latLng }, function(responses) { if (responses && responses.length > 0) { alert(responses[0].formatted_address); } else { alert('Cannot determine address at this location.'); } });
</script>
var lat = 21.211259534310496;
var long = 72.85025596618652;
var latLng = new google.maps.LatLng(lat, long);
geocoder.geocode({ latLng: latLng }, function(responses) { if (responses && responses.length > 0) { alert(responses[0].formatted_address); } else { alert('Cannot determine address at this location.'); } });
</script>
2 Comments
Thanks a lot my friend.....
ReplyDeleteIt works... :-)
Please , i'm new with javascript , i want to implement this code in an HTML file?
ReplyDeleteHow can i do that?