title: Center a V3 Google Map on route after directions are rendered
body: <p>I have a V3 map loading and centering on a particular longitude/latitude by default.  Once loaded, the user can enter their address to get directions to that point.  When this happens, the map is resized to accomodate a directions box to its left.  Because of this, the route is off-center in the map window.  I tried the following code, which I thought should logically work, but to no avail.</p>
  <p><b>New realization:</b> If I resize the window in any way, it begins to work as expected.</p>
  <p><b>Found the issue:</b> I needed to trigger <code>google.maps.event.trigger(map, 'resize')</code> after I resize the map container.</p>
  <pre><code>directionsService.route(query, function(result,status) {
      if (status === google.maps.DirectionsStatus.OK) {
          // This sets the directions container to display:block and resizes the map
          document.getElementById('map-container').className = "directions";
          directions.setDirections(result);
          var bounds = result.routes[0].bounds;
          map.fitBounds(bounds);
          map.setCenter(bounds.getCenter());
      } else {
          alert("");
      }
  });</code></pre>
  <p><strong>UPDATE 2018-05-22</strong></p>
  <p>With a new renderer release in version 3.32 of Maps JavaScript API the resize event is no longer a part of <code>Map</code> class.</p>
  <p>The documentation states</p>
  <blockquote>
  <p>When the map is resized, the map center is fixed</p>
  <ul>
  <li><p>The full-screen control now preserves center.</p>
  </li>
  <li><p><strong>There is no longer any need to trigger the resize event manually.</strong></p>
  </li>
  </ul>
  </blockquote>
  <p>source: <a href="https://developers.google.com/maps/documentation/javascript/new-renderer" rel="nofollow noreferrer">https://developers.google.com/maps/documentation/javascript/new-renderer</a></p>
  <p><code>google.maps.event.trigger(map, &quot;resize&quot;);</code> doesn't have any effect starting from version 3.32</p>