title: How to calculate driving distance between two given LatLng points?
body: <p>I need to calculate the driving distance between two points when latitude and longitude are given (not address)!
  How can I? </p>
  
  <pre><code>&lt;script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA7j_Q-rshuWkc8HyFI4V2HxQYPm-xtd00hTQOC0OXpAMO40FHAxT29dNBGfxqMPq5zwdeiDSHEPL89A" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  var geocoder, location1, location2, gDir;
  
  function initialize() {
      geocoder = new GClientGeocoder();
      gDir = new GDirections();
       location1 = {lat: '27.68389267163743', lon: '85.30214309692383', address: 'Sanepa'};
  
  
                      location2 = {lat: '27.674581642945725', lon: '85.32673358917236', address: 'Patan'};
                      gDir.load('from: ' + (location1.lat + ", " + location1.lon) + ' to: ' + (location2.lat + ", " + location2.lon));
  
  
  
  
      GEvent.addListener(gDir, "load", function() {
  
          var drivingDistanceKilometers = gDir.getDistance().meters / 1000;
          alert("Distance is" + drivingDistanceKilometers); 
      });
  }
  
  function showLocation() {
  
  
  
  
  
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>It works when i pass the address as parameters in gDir.load() function but now i need to calculate only from latitude and longitude. Please help.</p>