The InfoWindow's on the linked page have dynamic content(currently the address), I guess you don't need the address as content.
Currently the locations-array has the following structure.
[address1,address2,address3,....]
Request the infos and create an array with this structure:
[[address1,info1],[address2,info2],[address3,info3],....]
Change geocodeAddress()
into the following:
function geocodeAddress(details, next) {
//details[0] is the address, pass it as address-property to geocode
geocoder.geocode({address:details[0]}, function (results,status){
if (status == google.maps.GeocoderStatus.OK) {
var p = results[0].geometry.location;
var lat=p.lat();
var lng=p.lng();
//details[1] is the info fetched from the DB,
//pass it as add-argument to createMarker()
createMarker(details[1],lat,lng);
}else {
if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
nextAddress--;
delay++;
} else {}
}
next();
});
}
Note: echoing the single variables is not a good idea , a single-quote in either address(or the info) will result in a script-error(and there are more critical characters, e.g. linebreaks).
Populate a PHP-array with the values and use json_encode()
to print the array.