"+""+"
"+"

"+address+"

"); infoWnd.open(map, marker); }); //create the list item createMarkerButton(marker, colNum, listClass); return marker; }; /* * */ function createMarkerButton(marker, colNum, listClass) { // @TODO i need to do a comparison between li and marker.title and run with it from there. var ul = document.getElementById("locationsListing-"+colNum); if (!ul) { var div = document.getElementById("locationsList"); newUl = document.createElement("ul"); newUl.id = "locationsListing-"+colNum; if (typeof listClass !== 'undefined') { newUl.className = listClass; } div.appendChild(newUl); ul = document.getElementById("locationsListing-"+colNum); } var li = document.createElement("li"); var title = marker.title; li.innerHTML = ''+title+''; ul.appendChild(li); //add the click event google.maps.event.addDomListener(li, "click", function(){ google.maps.event.trigger(marker, "click"); }); } /* * Helper function for toggling a 'selected' class on the currently selected button. */ function toggleSelected(elem) { // Workaround for the fact that IE 8 doesn't have the 'getElementsByClassName' function. if (!document.getElementsByClassName) { document.getElementsByClassName = function(className) { return this.querySelectorAll("." + className); }; Element.prototype.getElementsByClassName = document.getElementsByClassName; } // Get all the map buttons, remove 'selected' class from all other buttons. var buttonArray = document.getElementsByClassName('map-button'); for (i = 0; i < buttonArray.length; i++) { var classes = buttonArray[i].className; if (buttonArray[i] != elem) { buttonArray[i].className = buttonArray[i].className.replace(" selected", ""); } } // If the current button doesn't have 'selected' class, add it. if (elem.className.search("selected") == -1) { elem.className = elem.className.concat(" selected"); } } /* * Helper function for creating a new colored icon. * Adapted for the Maps v3 API from Google's MapIconMaker library: * http://gmaps-utility-library.googlecode.com/svn/trunk/mapiconmaker/1.1/ */ function createMarkerIcon(opts) { var width = opts.width || 32; var height = opts.height || 32; var primaryColor = opts.primaryColor || "#ff0000"; var strokeColor = opts.strokeColor || "#000000"; var cornerColor = opts.cornerColor || "#ffffff"; var baseUrl = "http://chart.apis.google.com/chart?cht=mm"; var iconUrl = baseUrl + "&chs=" + width + "x" + height + "&chco=" + cornerColor.replace("#", "") + "," + primaryColor.replace("#", "") + "," + strokeColor.replace("#", "") + "&ext=.png"; var icon = { url : iconUrl, size : new google.maps.Size(width, height), anchor : new google.maps.Point(width / 2, height) }; return icon; }; //]]>