title: How to use computeDistanceBetween() correctly?
body: <p>I am newbie in Maps API, i am trying get the distance (in Km) from 2 adress. What is wrong with this code?</p>
  
  <pre><code>var mygc = new google.maps.Geocoder();
  
  var locationOrigem;
  var locationDestino;
  
  var latOrigem  = 0;
  var longOrigem = 0;
  
  var latDestino  = 0;
  var longDestino = 0;
  
  
  mygc.geocode({'address' : 'Presidente Vargas 897, Centro RJ'}, function(results, status){
  
      locationOrigem = results[0].geometry.location;
      latOrigem   = results[0].geometry.location.lat();
      longOrigem  = results[0].geometry.location.lng();
  
  });
  
  mygc.geocode({'address' : 'Abelardo Bueno 3000, Barra da Tijuca RJ'}, function(results, status){
  
      locationDestino = results[0].geometry.location;
      latDestino  = results[0].geometry.location.lat();
      longDestino = results[0].geometry.location.lng();
  
  });
  
  alert(google.maps.geometry.spherical.computeDistanceBetween(locationOrigem, locationDestino));
  </code></pre>
  
  <p>By a unknown reason, var <strong>locationOrigem and locationDestino</strong> are "undefined" outside of anonymous functions ??? Why???</p>