I am using Angular-Maps https://angular-maps.com/ within my Angular application
I have a working map showing markers etc although I have an issue with my map not loading on initial click , the map loads if I click out anywhere
getAddress() {
this.regForm = new FormGroup({
address1: new FormControl()
});
if (this.regForm.valid) {
if (this.locationSearchField !== undefined) {
const loqateAddress = this.locationSearchField.nativeElement.value;
if (loqateAddress.length > 0 && loqateAddress !== this.locationSearchFieldModel) {
this.locationSearchFieldModel = loqateAddress;
}
}
}
if (!this.geocoder) {
this.geocoder = new google.maps.Geocoder();
}
this.geocoder.geocode({
'address': this.locationSearchFieldModel
}, (results, status) => {
if (status == google.maps.GeocoderStatus.OK) {
// console.log('STATUS', status);
this.lat = results[0].geometry.location.lat();
this.lng = results[0].geometry.location.lng();
this.showmap = true;
this.searchaddress = false;
this.mapzoom = 14;
this.gettheaddress = this.locationSearchFieldModel;
this.searchaddressright = true;
} else {
alert('Sorry, this search produced no results.');
}
});
}