I recently started experimenting with the Google Maps API. I came across this excellent PHP Class called Phoogle which makes bringing in MySQL/PHP addresses and zipcodes into Google Maps and having it plotted.
Here is the website for Phoogle. My problem is that I'am trying to do a loop that will plot the points on the map but also fill in dynamic text in to the point textbox. Here is the code I'am using to fill in the information:
for($i =1; $i <= mysql_num_rows($result); $i++)
{
$address = print($zip['address']);
$zip = mysql_fetch_assoc($result);
$map->addAddress($zip['zip'], "$address");
}
My thinking behind this code is to have it plot the zip codes and then the $address variable would be the street address of the zipcode. In the example it shows that you can add in information to the textboxes like so:
//CUSTOM INFO WINDOW DATA
$map->addAddress('208 Dingler Ave, Mooresville, NC 28115',"This is <strong>a bold address</strong>");
$map->addAddress('210 Doster Ave, Mooresville, NC 28115',"<em>This is another address</em> that is italic");
$map->addAddress('300 Dingler Ave, Mooresville, NC 28115');
$map->addAddress('123 DoesNotExist, Mooresville, NC 28115');
$map->addAddress('345 DoesNotExist, Charlotte, NC 28202');
$map->showMap();
But this way of doing things is the manual way. Any thoughts on how I would be able to add dynamic information in to the window data? Or has anyone used Phoogle before in this way? Thanks for the help!