title: add button into google maps Angular2
body: <p>I am new in Angular and have a web app which displays a fullscreen google map.
  I want to add a "logout" button into the google map layout (not as header).</p>
  
  <p>I know with javascript Google Maps Api, it is possible like : </p>
  
  <pre class="lang-js prettyprint-override"><code>var Logout = document.getElementById('Logout');
  map.controls[google.maps.ControlPosition.TOP_RIGHT].push(Logout);
  </code></pre>
  
  <p>But with the <a href="https://angular-maps.com/" rel="noreferrer">AGM - Angular Google Maps</a>, I didn't find how.</p>
  
  <p>Now I have that :</p>
  
  <p><strong>map.component.html</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;button id="Logout" [(ngModel)]="logoutButton" class="toggle-button controls button" (click)="logout()"&gt;Logout&lt;/button&gt;
  
  &lt;agm-map [latitude]="lat" [longitude]="lng" [zoom]=12 [mapTypeControl]="true" (boundsChange)="centerChanged($event)" (idle)="loadParkings()" &gt;
  
      &lt;agm-marker *ngFor="let park of parkings" [latitude]="park.location[0]" [longitude]="park.location[1]"&gt;&lt;/agm-marker&gt;
  &lt;/agm-map&gt;
  </code></pre>
  
  <p><strong>map.component.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import {GoogleMapsAPIWrapper} from '@agm/core';
  
  declare var google: any;
  
  @Component({
    selector: 'app-map',
    templateUrl: './map.component.html',
    styleUrls: ['./map.component.css']
  })
  
  export class MapComponent implements OnInit {
    lat: number;
    lng: number;
    map: any;
    logoutButton: any;
  
    constructor(
      public mapApi: GoogleMapsAPIWrapper) {}
  
    ngOnInit(): void {
      if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(position =&gt; {
          this.lat = position.coords.latitude;
          this.lng = position.coords.longitude;
        });
      } else {
        this.lat = 47.2275654;
        this.lng = -1.3849729;
      }
    }
  
  
    logout() {
      this.authenficationService.logout();
      this.router.navigate(['/login']);
    }
  }
  </code></pre>