title: Center Google Maps InfoWindow On Load
body: <p>I'm having a problem centering my InfoWindow on page load. On load, the map is centering on the marker, which puts the InfoWindow off screen (I'm working with a short height for my map container).</p>
  
  <p>Now clicking the marker does re-center the map on the InfoWindow so that it looks exactly like I want. That being the case, I've even tried firing the marker.click trigger to achieve a solution on load, but had no luck. What am I missing?</p>
  
  <p><strong>JSFIDDLE: <a href="http://jsfiddle.net/q9NTS/7/" rel="nofollow">http://jsfiddle.net/q9NTS/7/</a></strong></p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      var geocoder = new google.maps.Geocoder();
      var marker;
      var infoWindow;
      var map;
      function initialize() {
          var mapOptions = {
              zoom: 15,
              mapTypeId: google.maps.MapTypeId.ROADMAP
          };
          map = new google.maps.Map(document.getElementById('map-canvas'),
              mapOptions);
          setLocation();
      }
  
      function setLocation() {
          var address = '@(Model.Event.Address)' + ', ' + '@(Model.Event.City)' + ', ' + '@(Model.Event.State)' + ' ' + '@(Model.Event.Zip)';
          geocoder.geocode({ 'address': address }, function (results, status) {
              if (status == google.maps.GeocoderStatus.OK) {
                  var position = results[0].geometry.location;
                  marker = new google.maps.Marker({
                      map: map,
                      position: position,
                      title: '@(Model.Event.Venue)'
                  });
                  map.setCenter(marker.getPosition());
  
                  var content = 'blah';
                  infoWindow = new google.maps.InfoWindow({
                      content: content
                  });
  
                  google.maps.event.addListener(marker, 'click', function () {
                      infoWindow.open(map, marker);
                  });
  
                  //infoWindow.open(map, marker); doesn't work
                  google.maps.event.trigger(marker, 'click'); //still doesn't work
              }
              else {
                  //
              }
          });
      }
  
      google.maps.event.addDomListener(window, 'load', initialize);
  &lt;/script&gt;
  </code></pre>