Is there a way to properly return the latlon variable from the codeAddress function? The typical 'return latlon' doesn't seem to work, possibly due to scope issues. Any suggestions on how to resolve this?
function codeAddress(addr) {
if (geocoder) {
geocoder.geocode({ 'address': addr}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var latlon = results[0].geometry.location.c+","+results[0].geometry.location.b;
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
}