I have built a simple map application with a single marker over my office. The marker drops in after the map is built. I would like to trigger a mouseover event after the marker is displayed but it never seems to work. To be clear, I want the default behavior of mouseover, which is to display a simple window with the marker title, to occur from code, not from mousing over the marker. This seems to be the opposite of most of the queries here.
I’ve tried this:
setTimeout("google.maps.event.trigger( marker, 'mouseover');alert(marker.title);",5000);
In this case the alert happens but the mouseover doesn’t seem to. Without the alert there are no messages or errors, the trigger just gets swallowed.
Are there parameters for the mouseover event that I am missing? It doesn’t seem so from the documentation, but I can imagine a whole bunch of missing info, primarily where the window should display and for how long.
I imagine that my approach is completely wrong, but according to my reading of the documentation it should work. An alternative of course is to create an InfoWindow like this:
iw = new google.maps.InfoWindow({position: LL, content: marker.title});
iw.open(map, marker);
which works, but the window is fairly ugly compared to what pops up during the mouseover.
Maybe another way of wording my question is HOW CAN I DISPLAY AN INFORMATION WINDOW THAT LOOKS JUST LIKE THE MOUSEOVER WINDOW?
thanks
You’ll need to make your own overlay or there are a few which can get you close.
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/examples/example.html/
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/examples.html