title: Google Map does not center even after resize
body: <p>OK, so I have a Jquery Dialog and within a Google Maps v3 canvas. The dialog is opened when clicked on a link and the map is centered to the Marker which is associated with the link. Now, all works fine the FIRST time. the map is shown and centered to the marker's position. When I close the dialog, and click on another link. The map is show but the marker is just outside the map area, the well known top left corner. I need to drag the map a bit to make the marker appear.
  OK, so I have added multiple resizes and setCenter's in the code but it still does not work. </p>
  
  <p>What is going wrong???</p>
  
  <p>Here's the code
      
      var map;</p>
  
  <pre><code>        $(document).ready(function() {
  
              $("#map_container").dialog({
                  autoOpen : false,
                  resizable : false,
                  resizeStop : function(event, ui) {
                      google.maps.event.trigger(map, 'resize')
                  },
                  open : function(event, ui) {
                      google.maps.event.trigger(map, 'resize');
                  },
                  close : function(event, ui) {
                      map = null;
                  }
              });
  
              $(".show_on_map").click(function(e) {
  
                  alert("click");
  
                  var lat = $(this).attr('lat');
                  var lng = $(this).attr('lng');
                  var placeName = $(this).attr('placeName');
                  var placeAddress = $(this).attr('placeAddress');
  
                  initialize(lat, lng);
                  plotPoint(lat, lng, placeName, '&lt;span class="gBubble"&gt;&lt;b&gt;' + placeName + '&lt;/b&gt;&lt;br&gt;' + placeAddress + '&lt;/span&gt;');
  
                  $("#map_container").dialog("open");
  
              });
  
          function plotPoint(srcLat, srcLon, title, popUpContent, markerIcon) {
              var myLatlng = new google.maps.LatLng(srcLat, srcLon);
              var marker = new google.maps.Marker({
                  position : myLatlng,
                  map : map,
                  title : title,
                  icon : markerIcon
              });
              var infowindow = new google.maps.InfoWindow({
                  content : popUpContent
              });
              google.maps.event.addListener(marker, 'click', function() {
                  infowindow.open(map, marker);
              });
  
                              google.maps.event.trigger(map, 'resize');
  
              map.setCenter(myLatlng);
  
          }
  
          function initialize(lat, lng) {
  
              var latlng = new google.maps.LatLng(lat, lng);
              var myOptions = {
                  zoom : 13,
                  center : latlng,
                  mapTypeId : google.maps.MapTypeId.ROADMAP
              };
  
              map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
              google.maps.event.trigger(map, 'resize');
  
              map.setCenter(latlng);
          }
  &lt;/script&gt;
  </code></pre>
  
  <p>Here's the DIV.</p>
  
  <pre><code>&lt;div id="map_container" style="width:300px;height:300px;"&gt;
          &lt;div id="map_canvas" style="width:250px;height:250px;"&gt;&lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Any help is greatly appreciated.
  Coen</p>