I have json data formated like that in an addresses variable : [{"address":"56 rue de la liberte 33000 bordeaux"},{"address":"38 rue de Paris 92000 Paris"},{"address":"12 rue du petit chat noir 47300 villeneuve sur lot"}]
and i have my geocode function :
var addresses = json
function geocodeAddress(location) {
geocoder.geocode({ address: location }, function (results, status) {
//alert(status);
if (status == google.maps.GeocoderStatus.OK) {
//alert(results[0].geometry.location);
console.log(results);
} else {
alert("some problem in geocode" + status);
}
});
}
how can i pass my address data to the geocode function ?
I did geocodeAddress(addresses)
but it dooesnt't work.
How can i pass json data as an argument to this function ?
Thanks