Am unable to display mapLoc value in front end... any help?
Here is my component.ts file
export class mycomponent{
mapLoc:any;
constructor(){...}
openImageModal(lat,lng){
this.mapLoc = '';
var latlng = new google.maps.LatLng(lat, lng);
var geocoder = geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'latLng': latlng }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[1]) {
console.log(results[1].formatted_address); //able to console
this.mapLoc = results[1].formatted_address;
}
}
});
}
this is mycomponent.html file
<ngui-map zoom="{{zoom}}" center="{{lat}}, {{lng}}" (mapReady$)="onMapReady($event,lat,lng)" (mapClick)="onMapClick($event)" (idle)="onIdle($event)">
<marker *ngFor="let pos of position" [position]="[pos.lat, pos.lng]" draggable="true" (initialized$)="onMarkerInit($event)"></marker>
<info-window id="iw">
<div *ngIf="marker.display">
{{mapLoc}}
</div>
</info-window>
</ngui-map>