1

I have never used JavaScript. In my application I am using SQL Server database 2005 which contains almost 2200 addresses of a particular city. I have to find the latitude and longitude of all these locations. For that I want to use JavaScript. Can someone guide me how to use JavaScript for finding latitude and longitude of multiple addresses?

Peter O.
  • 32,158
  • 14
  • 82
  • 96
user1387035
  • 209
  • 4
  • 9
  • Why does it need to be JavaScript? First build your server application and show it to us, then we might lead you to how to enhance it with JS. – Bergi Jun 28 '12 at 09:56

1 Answers1

1

Try this :

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false">
<script type="text/javascript">

var geocoder = new google.maps.Geocoder();
var address = "new york";

geocoder.geocode( { 'address': address}, function(results, status) {

if (status == google.maps.GeocoderStatus.OK) {
    var latitude = results[0].geometry.location.lat();
    var longitude = results[0].geometry.location.lng();
    } 
}); 
</script>

Ravinder Singh
  • 3,113
  • 6
  • 30
  • 46