How do I return the latlon variable for codeAddress function. return latlon doesn't work, probably because of scope but I am unsure how to make it work.
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);
}
});
}
}