title: Google Map V3 - Set map bounds
body: <p>When I plot a route in google maps v3, I'm able to push to coordinates into a bounds object and then get the map to zoom to a level that shows the entire route.  I'm also able to set the center of the map to equal the middle of the route:</p>
  
  <pre><code>var bounds = new google.maps.LatLngBounds();
  
  bounds.extend(latlng); //do this for each coordinate
  
  map.fitBounds(bounds);
  map.setCenter(bounds.getCenter());
  </code></pre>
  
  <p>However, I've added an overlay on the left.  The map is 100% screenwidth and goes underneath the overlay:</p>
  
  <p><a href="https://i.stack.imgur.com/4YN2V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4YN2V.png" alt="enter image description here"></a></p>
  
  <p>Is it possible to set the map boundaries to match what is visible? (I've highlighted what I mean with a green border) And there make sure the entire route is visible to the right of the overlay?</p>
  
  <p>I hope this makes sense.  Google manage to accomplish this on their map site.</p>