Я хочу получить LatLng введенного адреса в текстовом поле.Я использую Google Map API для этого.Записав только новый google.maps.places.Autocomplete ({}) Я получаю Не могу прочитать свойства 'местах' с неопределенной этой ошибкой.
Ниже моякод:
@ViewChild('addressText') addressText: any;
ngAfterViewInit() {
this.getPlaceAutocomplete();
}
getPlaceAutocomplete() {
const autoComplete = new google.maps.places.Autocomplete(this.addressText.nativeElement, {
types: this.addressText.nativeElement.value
})
// google.maps.event.addListener(autoComplete, 'place_changed', () => {
// const place = autoComplete.getPlace();
// console.log('places... ', place);
// })
}
HTML-файл:
<input matInput placeholder="Locations" class="input" formControlName="text" #addressText>
Пожалуйста, помогите мне.