title: Google Maps API fit bounds
body: <p>I have a collection of markers which all show in the correct place on my map. I then use the following code to set the bounds of the map so all markers are visisble.</p>
  
  <pre><code>bounds = new maps.LatLngBounds();
  
  angular.forEach($scope.places, function(place) {
      bounds.extend(new maps.LatLng(place.getLatitude(), place.getLongitude()));
  });
  
  console.log(bounds);
  map.fitBounds(bounds);
  console.log(map.getBounds());
  </code></pre>
  
  <p>However the map ends up in some random spot where there are no markers at all. The console.log shows the bounds set are not quite the same as the bounds that are returned from getBounds().</p>
  
  <pre><code>// var bounds;
  j: 40.793571
  k: 40.715086
  
  va: ih
  j: -74.00108699999998
  k: -73.951866
  </code></pre>
  
  <p>and</p>
  
  <pre><code>// getBounds();
  j: 40.828484316202136
  k: 40.68011306824231
  
  j: -74.09878523107909
  k: -73.85416776892089
  </code></pre>