step by step

  1. create a div where you will put the map and add a template reference variable to it
    < div class="map" #mapElement>< / div >
  2. give height to the div (empty divs usually have 0 height)
    .map { height: 90vh; }
  3. select your div in the component
    @ViewChild('mapElement') mapElm: ElementRef;
  4. place your map on the div
    this.map = new maps.Map(this.mapElm.nativeElement, {.. details here ..});