title: Google maps API v3 JS: Why am I getting no return from this function?
body: <p>I am using the Google Maps API Geocoder to try and get lat/lng from an address.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      function geocodeAddress(address) {
          geocoder.geocode({address:address}, function (results,status){
              if (status == google.maps.GeocoderStatus.OK) {
                  var p = results[0].geometry.location;
                  var lat=p.lat();
                  var lng=p.lng();
                  var location = '{'+lat+','+lng+'}';
                  // If I alert(location) here, I get the correct lat/lng
                  return location;
                  // The return isn't happening?
              } else {
                  alert('GeoCoder problem');
              }
          });
      }
  
      var geocoder = new google.maps.Geocoder();
      var point = geocodeAddress('Cape Town Carnival, Somerset Road, Green Point, South Africa');
      alert(point);  // this returns "Undefined".
  &lt;/script&gt;
  </code></pre>
  
  <p>This is in FF.  I am getting no JS errors. I am not a JS expert.  can anyone see what I am doing wrong?</p>
  
  <p>Thanks</p>
  
  <p>J </p>