title: Set Google Maps bounds with angular-google-maps
body: <p>I'm trying to set bounds into Google Maps instance but with no success. I'm using AngularJS and <code>angular-google-maps</code> module. My last try was: </p>
  
  <pre><code>&lt;div id="map_canvas"&gt;
      &lt;ui-gmap-google-map 
          center="map.center" 
          zoom="map.zoom"
          bounds="map.bounds"
          options="options"&gt;
  
          &lt;div ng-repeat="d in devicesMarkers track by d.id"&gt;
  
              &lt;ui-gmap-marker
                  idkey="d.id"
                  coords="d.center"
                  options="d.options"&gt;
              &lt;/ui-gmap-marker&gt;
              &lt;ui-gmap-circle
                  center="d.center"
                  stroke="d.circle.stroke"
                  fill="d.circle.fill"
                  radius="d.circle.radius"
                  visible="d.options.visible"&gt;
              &lt;/ui-gmap-circle&gt;
  
          &lt;/div&gt;
  
      &lt;/ui-gmap-google-map&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In my <code>app.js</code> I wrote:</p>
  
  <pre><code>(...)
  .controller('TaihMapController', ['$scope', '$log', 'uiGmapGoogleMapApi', function($scope, $log, GoogleMapApi) {
      $scope.devicesMarkers = devices;
      $scope.map = {
          center: { latitude: devices[0].center.latitude, longitude: devices[0].center.longitude },
          zoom: 12,
          bounds: {}
          // fit: true,
      };
      GoogleMapApi.then(function(maps) {
          $log.debug(maps);
          var myBounds = new maps.LatLngBounds();
          for (var k = 0; k &lt; devices.length; k++) {
              var _tmp_position = new maps.LatLng(
                  devices[k].center.latitude, 
                  devices[k].center.longitude);
              myBounds.extend(_tmp_position);
          }
      $scope.map.bounds = myBounds;
      $scope.googleVersion = maps.version;
      // $scope.bounds = myBounds;
      // $scope.zoom = maps.getZoom();
      // maps.fitBounds(myBounds);
      // $scope.bounds = maps.getBounds();
  
  });
  </code></pre>
  
  <p>The function <code>maps.fitBounds()</code> doesn't exist. I try the <code>$scope.map.bounds</code> approach, but didn't respond the way I think.</p>