i am trying to get adress by a function where i just have to give latLong but i am with a real problem to save de value to return or return it simple
function getadress(latLong){
var adress ="";
geocoder.geocode( {'latLng': latLng},
function(results, status) {
if(status == google.maps.GeocoderStatus.OK) {
if(results[0]) {
adress = results[0].formatted_address; // wrong way result empty
alert(results[0].formatted_address); // result perfect adress
return results[0].formatted_address // result undefiened
}
else {
adress = "No results";
}
}
else {
adress = status;
}
});
return adress;
}