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;
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to