title: IONIC 3: Uncaught (in promise): ReferenceError: google is not defined ReferenceError
body: <p>How are you?. I am studying a Google Maps with Ionic 3 tutorial. I have done everything what is explained there, but when the project is launched, there is appearing this error. I have investigated A LOT, but nothing works. Thanks!.</p>
  
  <pre><code>Error: Uncaught (in promise): ReferenceError: google is not defined
  ReferenceError: google is not defined
  </code></pre>
  
  <p>This is my code:</p>
  
  <p><strong>home.ts</strong></p>
  
  <pre><code>import { Component, ViewChild, ElementRef } from '@angular/core';
  import { NavController } from 'ionic-angular';
  import { IonicPage } from 'ionic-angular';
  
  declare var google;
  
  @IonicPage()
  @Component({
  selector: 'page-home',
  templateUrl: 'home.html'
  })
  export class HomePage {
  
      @ViewChild('map') mapElement:ElementRef;
      map: any;
      start = 'chicago, il';
      end = 'chicago, il';
      directionsService = new google.maps.DirectionsService;
      directionsDisplay = new google.maps.DirectionsRenderer;
  
      constructor(public navCtrl: NavController) {
  
      }
  
      ionViewLoad(){
          this.initMap();
      }
  
      initMap(){
          this.map = new google.maps.Map(this.mapElement.nativeElement, 
      { 
              zoom: 7,
              center: {lat: 41.85, lng: -87.65}
      });
  
          this.directionsDisplay.setMap(this.map);
      }
  
      calculateAndDisplayRoute(){
          this.directionsService.route({
              origin: this.start,
              destination: this.end,
              travelMode: 'DRIVING',
          }, (response, status) =&gt; {
              if(status == 'OK'){
                  this.directionsDisplay.setDirections(response);
              }else{
                  window.alert('Directions request failed due to ' + 
          status);
              }
          });
          }
  
       }
  </code></pre>