title: Cannot read property 'maps' of undefined : AGM-MAP
body: <p>I am using google map to pinpoint locations of devices using my app.I am using angular 6 and integrated google map using agm-map library. Everything is working fine but when i  try to set bounds to the map so that map shows every marker i get this error,</p>
  
  <pre><code>core.js:1598 ERROR TypeError: Cannot read property 'maps' of undefined
      at device-location.view.ts:45
      at SafeSubscriber.schedulerFn [as _next] (core.js:3724)
      at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:253)
      at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:191)
      at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:129)
      at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:93)
      at EventEmitter.push../node_modules/rxjs/_esm5/internal/Subject.js.Subject.next (Subject.js:53)
      at EventEmitter.push../node_modules/@angular/core/fesm5/core.js.EventEmitter.emit (core.js:3704)
      at map.js:220
      at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:388)
  </code></pre>
  
  <p>Here you can see my code below,</p>
  
  <pre><code> ngOnInit() {
        this.devices$.subscribe(data =&gt; {
          if (data) {
              this.devices = data;
          }
        });
      }
  
    ngAfterViewInit() {
  
      this.agmMap.mapReady.subscribe(map =&gt; {
        const bounds: LatLngBounds = new google.maps.LatLngBounds(); // HERE GOOGLE UNDEFINED
        for (const dev of this.devices) {
          bounds.extend(new google.maps.LatLng(dev.latitude, dev.longitude));
        }
        map.fitBounds(bounds);
      });
    }
  </code></pre>
  
  <p>This is the line of code where the error occurs,</p>
  
  <pre><code>const bounds: LatLngBounds = new google.maps.LatLngBounds();
  </code></pre>
  
  <p>Can anyone help me with this issue? Thank you</p>