title: gmap3 show address in infowindow
body: <p>I have a click event on my map markers to create an infowindow, i am trying to geocode the address to show inside the infowindow.</p>
  
  <pre><code>            click: function(marker) {
                  pantoUser(lati,longi,i);
                  addInfoWindow(lati,longi,name,datestring);
              }
  </code></pre>
  
  <p>I nearly have it working like so:</p>
  
  <pre><code>function addInfoWindow(lati,longi,name,datestring)
  {
   // get address  
  getAddress(lati,longi);
  
   // create infowindow
  $('#dispatcher').gmap3(
    { action: 'addInfoWindow',
      latLng: [lati, longi],
      infowindow:{
        options:{
          content: name
        },
        events:{
          closeclick: function(infowindow, event){
            //alert('closing : ' + $(this).attr('id') + ' : ' + infowindow.getContent());
          }
        },
        apply:[
          { action:'setContent', 
            args:[
            '&lt;span class="infowindow"&gt;' + name + '&lt;br /&gt;' + content + '&lt;br /&gt;' + datestring + '&lt;span&gt;'
            ]
          }
        ]
      }
    }
  );
  </code></pre>
  
  <p>}</p>
  
  <p>and then the get address part:</p>
  
  <pre><code> function getAddress(lati,longi)
  {
      $("#dispatcher").gmap3({
               action:'getAddress',
               latLng: [lati, longi],
               callback:function(results){
               content = results &amp;&amp; results[1] ? results &amp;&amp; results[1].formatted_address : 'No Address';
           return content;
                  }
  
         });
  }
  </code></pre>
  
  <p>The problem is that the geocoded address is always one marker click behind. For example i may click on a marker in london and nothing happens. So i click it again and i get the infowindow with the address. Then i click on a marker in Manchester and i still see the london address, then i click on a marker in Liverpool and i get the Manchester address. and so on.</p>
  
  <p>Can anyone spot the bug?</p>
  
  <p><strong>UPDATED WORKING SOLUTION FROM SEAN</strong>
  Added the infowindow code in the callback</p>
  
  <pre><code>function addInfoWindow(lati,longi,name,datestring)
  {
  // get address
  $("#dispatcher").gmap3({
       action:'getAddress',
       latLng: [lati, longi],
       callback:function(results){
       content = results &amp;&amp; results[1] ? results &amp;&amp; results[1].formatted_address : 'No Address';
  
  // create infowindow       
  $('#dispatcher').gmap3(
    { action: 'addInfoWindow',
      latLng: [lati, longi],
      infowindow:{
        options:{
          content: name
        },
        events:{
          closeclick: function(infowindow, event){
            //alert('closing : ' + $(this).attr('id') + ' : ' + infowindow.getContent());
          }
        },
        apply:[
          { action:'setContent', 
            args:[
            '&lt;span class="infowindow"&gt;' + name + '&lt;br /&gt;' + content + '&lt;br /&gt;' + datestring + '&lt;span&gt;'
            ]
          }
        ]
      }
    }
  );
  
      } // end callback
  
   });
  </code></pre>
  
  <p>}</p>