I had seen some posts with questions about how to open up a lighbox
from a click within an infoWindow, but had not seen any solutions so
thought that I would post.
First off I found a post which discusses the issues here (http://
www.umaitech.com/cms/?p=41), but the code and examples are for Maps
API V2 and an older version of slimbox. But a little reading on the
current version of slimbox (jQuery based version), specifically the
API call to open and I was able to get it working.
The code to create the marker ended up looking like this:
function createMarker(latlng, name, address, thumbImage, couponImage)
{
var marker = new google.maps.Marker({
map : map,
position : latlng,
title : name
});
var div = document.createElement('div');
var html = "<b>" + name + "</b> <br/>"
+ "<a onclick='jQuery.slimbox(\""+ couponImage + "\",
\"Caption");return false'>"
+ "<img src='" + thumbImage + "'></a>";
div.innerHTML = html;
google.maps.event.addListener(marker, 'click', function() {
infoWindow.setContent(div);
infoWindow.open(map, marker);
});
return marker;
}