title: How can I center and zoom Google Maps after resizing the map container?
body: <p>I have a map with many markers.</p>
  
  <p><a href="https://i.stack.imgur.com/iUMab.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iUMab.jpg" alt="enter image description here"></a></p>
  
  <p>After resizing the map, it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/o59aE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o59aE.jpg" alt="enter image description here"></a></p>
  
  <p>and I want this:</p>
  
  <p><a href="https://i.stack.imgur.com/aBmJf.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aBmJf.jpg" alt="enter image description here"></a></p>
  
  <p>How can I zoom in and center the map on the markers after resizing?</p>
  
  <p>I have the following code;</p>
  
  <pre><code>var map;
  
  var GoogleMaps = {
    setMarkers: function(stores){
      map = new google.maps.Map(document.getElementById('map-canvas'));
  
      $.each(stores, function (key, store) {
        /* (..) */
        bounds.extend(latLng);
      });
  
      map.fitBounds(bounds);
  
      // This part is never triggered
      google.maps.event.addDomListener(window, 'resize', function() {
        var center = map.getCenter();
        google.maps.event.trigger(map, "resize");
        map.setCenter(center);    
      });
    }
  }
  </code></pre>
  
  <p>HTML<br>
  When I click the resize icon, I add a css class to <code>map-canvas</code> </p>
  
  <pre><code>&lt;div class="map-container alt-row row-spacer clearfix"&gt;
    &lt;section class="column12"&gt;
      &lt;div id="map-canvas" class=""&gt;&lt;/div&gt;
    &lt;/section&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I've looked at similar questions (<a href="https://stackoverflow.com/questions/20517053/centering-google-maps-on-responsive-resize-with-marker">here</a> and <a href="https://stackoverflow.com/questions/18444161/google-maps-responsive-resize">here</a>), but they do not solve my problem. </p>
  
  <p>Does anyone know how I can accomplish this? You can <a href="http://jsfiddle.net/d7fykbzm/6/" rel="nofollow noreferrer">look at my JSFiddle here</a>.</p>