title: Return address from Google Maps Geocoder v3
body: <p>I have the following function:</p>
  
  <pre><code>$(function() {
       var address = $("#address").text();
       var r;
  
       function encodeAddress() {
         geocoder = new google.maps.Geocoder();
         geocoder.geocode({'address' : address}, function(results, status) {
           if (status == google.maps.GeocoderStatus.OK) {
             results[0].geometry.location
             r = results[0].geometry.location
             console.log("inside:" + r);
           } else {
             alert("Google Maps had some trouble finding" + address + status);
           }
         });
       }
  
      encodeAddress()
      console.log("outside:" + r);
  });
  </code></pre>
  
  <p>I am trying to return the geocoded address for use with Street View as well as Gmap.  Inside returns the correct value and the outside returns underfined.</p>
  
  <p>All help is greatly appreciated, I did read somewhere else that it is not possible to return the value this way but had to check with the trusty StackOverflow community.</p>
  
  <p>Thank you in advance.</p>