I have some issues defining position
inside my geocode
function.
I do get the right result in my function, but i can't use it outside the function.
var position;
var geocoder = new google.maps.Geocoder();
geocoder.geocode({
'address': row.Address + ' ' + row.Postal_Code + ' ' + row.City + ' ,' + row.Country
}, function(results, status) {
if(status == google.maps.GeocoderStatus.OK) {
position = results[0].geometry.location; // console.log(position) // correct result
}
});
console.log(result); // Undefined