我有以下HTML来显示选择位置,下面将显示该 Map .

我对上面的视图有以下HTML,

<mat-form-field class="locationSelector">
  <mat-select placeholder="Choose location" (ngModel)="ServiceLocations">
   <mat-option *ngFor="let location of ServiceLocations" [value]="location" style="width:200px; background-color: red; font-size: 10px;">
     {{ location.areaName }}
   </mat-option>
  </mat-select>
 </mat-form-field>
 <div>
   <agm-map [latitude]="latitude" [longitude]="longitude" [zoom]="zoom">
   </agm-map>
  </div>

相应的CSS是,

agm-map {
    height: 300px;
    position: relative;
}

.locationSelector {
    width: 20%;
}

我得到的观点是,

enter image description here

当我点击选择选项时,我得到如下视图,

enter image description here

请纠正我错在哪里 .

所有必需的材料组件都在app.module.ts中导入