i am using google maps api v3, and the InfoBubbles plugin. I am trying to populate the map with multiple markers. Each marker has a InfoBubble that opens when clicked. These InfoBubbless have tabs (up to 3 tabs) each with their own content and html.
How can i get the markers to show on the maps with their tabs and infobubbles.
I am currently setting the infobubbles and markers to arrays and using a public function to handle the click, while passing the index.
infoBubbles[i] = new InfoBubble({
map: map,
minHeight: point[i].min_height,
maxHeight: point[i].max_height,
minWidth: point[i].min_width,
maxWidth: point[i].max_width,
disableAutoPan: false,
hideCloseButton: false,
arrowPosition: 30,
padding:12
});
google.maps.event.addListener(marker, 'click', handleMarkerClick(marker, i));
and the marker click function:
function handleMarkerClick(marker,index) {
return function() {
if (!infoBubbles[index].isOpen()) {
infoBubbles[index].open(map, marker);
}else{
infoBubbles[index].close(map, marker);
}
}
}