小编Cry*_*182的帖子

地图自动完成功能未以模态角度显示。z 索引不起作用

我面临着一个让我发疯的问题。我正在开发一个有角度的项目,我需要将地图搜索放入模态窗口中。我使用了 ng bootstrap modals 和谷歌地图。

这是我的 .ts:

    @Component({
  selector: 'app-classroom-detail-dialog',
  templateUrl: './classroom-detail-dialog.component.html',
  styleUrls: ['./classroom-detail-dialog.component.css']
})
export class ClassroomDetailDialogComponent implements OnInit {
  @Input() idClassroom: number;
  classroom: Class;
  edit: boolean = true;

  public latitude: number;
  public longitude: number;

  public searchControl: FormControl;
  @ViewChild("search") public searchElementRef: ElementRef;

  constructor(public activeModal: NgbActiveModal, public classroomService: ClassroomService,
    public mapsAPILoader: MapsAPILoader, public ngZone: NgZone) { }

  ngOnInit() {
    this.classroomService.getClassroomDetail(this.idClassroom).subscribe(classroom=>{
      this.classroom = classroom;
      this.latitude = this.classroom.latitude;
      this.longitude = this.classroom.longitude;
    });
    //create search FormControl
    this.searchControl = new FormControl();

    //load Places Autocomplete …
Run Code Online (Sandbox Code Playgroud)

css maps autocomplete angular

3
推荐指数
1
解决办法
2644
查看次数

标签 统计

angular ×1

autocomplete ×1

css ×1

maps ×1