Problem of recovery of coordinates with the geocoder
displayLocation=(latitude,longitude)=>{
this.geocoder = new google.maps.Geocoder;
var latlng = new google.maps.LatLng(latitude, longitude);
let add;
this.geocoder.geocode(
{'latLng': latlng},
(results, status) => {
if (status == google.maps.GeocoderStatus.OK) {
if (results[0]) {
add = results[0].formatted_address ;
let value = add.split(",");
this.yourlocate = add;
}
else {
return this.yourlocate = "address not found";
}
}
else {
return this.yourlocate = "Geocoder failed due to: " + status;
}
}
);
}
this.yourlocate is empty why please Help me to return this value