Google Map API – Markers with Pop Up Windows

Another need I had was to have map markers pulling data from an xml file that also had “pop up” windows functionality with information about that specific marker. As a result I put together the following bit of script.  The lat/lng and information about each marker point are loaded from an xml file named popupdata.xml and then added to the map.  When a marker point is clicked on, it pulls the html I have specified in the map javascript as well as the variables I have identified and populated in the xml file. While this example is quite simple(with only date and address and simple html), there are very interesting possibilities since you can have complex html and include pictures and  if you desire. If you are going to use this example for yourself, just add your Google Maps API key and enter the addresses and variables you want to add. You will need to add the variable names to both the javascript and the xml file. Since this will all be easier to understand with an example, I have included one.

You can visit a LIVE SAMPLE or download the full html page and associated data.xml file from HERE.