I'm getting crazy with this.
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
latitude = results[0].geometry.location.lat();
longitude = results[0].geometry.location.lng();
locations[j][0] = direcciones[j]['1'];
locations[j][1] = latitude;
locations[j][2] = longitude;
locations[j][3] = direcciones[j]['10'];
j++;
}
});
If I do an alert of locations[0][0] inside geocode function, it works fine, but if I do it out, i get the previous value, because I am not modifying global locations variable...
Someone could help me to chenge correctly that variable?