title: Property 'map' is used before its initialization. (Google Maps in Angular)
body: <p>I am working on implementing <code>google maps</code> in an angular webpage but I am getting this error (The app still works)</p>
  <p>Edit:
  Just to clarify, The map works, the markers also work, I'm just getting the error in my Visual studio code and a method not implemented in my inspection of the webpage(which is an exception by the map not being initialized)</p>
  <blockquote>
  <p>ERROR in src/app/app.component.ts:29:15 - error TS2729: Property 'map' is used before its initialization.<br><br>
  29     map: this.map,<br>
  ~~~<br><br>
  src/app/app.component.ts:15:3
  15   map: google.maps.Map;<br>
  ~~~
  'map' is declared here.
  src/app/app.component.ts:36:15 - error TS2729: Property 'map' is used before its initialization.<br><br>
  36     map: this.map,<br>
  ~~~<br><br>
  src/app/app.component.ts:15:3<br>
  15   map: google.maps.Map;
  ~~~<br>
  'map' is declared here.<br></p>
  </blockquote>
  <p>my app <strong>component.ts</strong></p>
  <pre class="lang-typescript prettyprint-override"><code>    import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core';
          
      @Component({
        selector: 'app-root',
        templateUrl: './app.component.html',
        styleUrls: ['./app.component.css']
      
      })
      export class AppComponent implements AfterViewInit  {
        title = 'maps-v1';
        @ViewChild('mapContainer', {static: false}) gmap: ElementRef;
        map: google.maps.Map;
        lat = 37.37;
        lng = -122.04;
        coordinates = new google.maps.LatLng(this.lat, this.lng);
      
      
        mapOptions: google.maps.MapOptions = {
          center: this.coordinates,
          zoom: 12,
          gestureHandling:&quot;cooperative&quot;,
        };
      
        marker = new google.maps.Marker({
          position: this.coordinates,
          map: this.map,
          title:&quot;Start&quot;
        });
      
        mark2=new google.maps.Marker({
          label: &quot;TEST&quot;,
          position:{lat:37.37,lng:-122.03},
          map: this.map,
          title:&quot;TESTERSZ&quot;
      
        });
      
        ngAfterViewInit(){
          this.mapInitializer();
          throw new Error('Method not implemented.');
          
        }
        
      
        mapInitializer() {
          this.map = new google.maps.Map(this.gmap.nativeElement, 
          this.mapOptions);
          this.marker.setMap(this.map);
          this.mark2.setMap(this.map);
      
         }
         
      }
  </code></pre>
  <p>Any help would be appreciated</p>