I\'ve a page with markers with InfoWindows that I opened on Click. I decided to rather open the InfoWindows on MouseOver which is working.
But I find that having to
Try this:
google.maps.event.addListener(CalMarker, 'mouseover', function() {
//open the infowindow when it's not open yet
if(contentStringCal!=infowindow.getContent())
{
infowindow.setContent(contentStringCal);
infowindow.open(map,CalMarker);
}
});
google.maps.event.addListener(CalMarker, 'click', function() {
//when the infowindow is open, close it an clear the contents
if(contentStringCal==infowindow.getContent())
{
infowindow.close(map,CalMarker);
infowindow.setContent('');
}
//otherwise trigger mouseover to open the infowindow
else
{
google.maps.event.trigger(CalMarker, 'mouseover');
}
});
//clear the contents of the infwindow on closeclick
google.maps.event.addListener(infowindow, 'closeclick', function() {
infowindow.setContent('');
});
Demo: http://jsfiddle.net/doktormolle/JXqLa/