What I do is store a global reference to the clicked marker when I open
the info window.
var lastmarker; // global variable
function createMarker(...) {
var marker = newGMarker(point);
GEvent.addListener(marker, "click", function() {
lastmarker = marker; // save the global reference
marker.openInfoWindowHtml( ... )
});
}
By far the easiest way to change the info window size is to re-open it
with changed contents. One neat way to do that is to use a custom event.
E.g. arrange for the element inside the window to use
onclick = 'GEvent.trigger(lastmarker, "Click2")'
and add code to your createMarker() function to open the info window
with the different contents when there's a "Click2" event.
function createMarker(...) {
var marker = newGMarker(point);
GEvent.addListener(marker, "click", function() {
lastmarker = marker; // save the global reference
marker.openInfoWindowHtml( ... )
});
GEvent.addListener(marker, "Click2", function() {
marker.openInfoWindowHtml( ... different contents ... )
});
}
--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---