Triggering marker.openInfoWindowHtml from outside of a map

16 views
Skip to first unread message

stewamax

unread,
Sep 8, 2009, 8:51:34 AM9/8/09
to Google AJAX APIs
I use the maps API to display a map with a selection of custom-built
markers at various locations added using Marker Manager. Mousing over
a marker opens an InfoWindow with a photo of the location plus its
name. Clicking the marker replaces the photo with a zoomed-in
MapBlowup. All works fine.
I have now been asked to display a table (a normal HTML list or table)
outside of the map containing a list of some of the more obscure
locations such that if the user clicks (or perhaps mouses over) one of
these location names, the corresponding marker on the map comes into
‘focus’ and displays its InfoWindow.
This would be trivial job on a conventional static map – just use
hotspot rollovers – but I am at a loss how to do this on my Google
map. I think I need to simulate the effect of a marker mouseover such
that (e.g.) my
google.maps.Event.addListener(marker, "mouseover", function() {
marker.openInfoWindowHtml(html_text);})
is triggered by selecting or mousing over the appropriate item in the
list.

Any suggestions on the best way to do this pls?

Jeremy Geerdes

unread,
Sep 8, 2009, 11:27:41 AM9/8/09
to google-ajax...@googlegroups.com
You actually have the right idea. Set mouseover and mouseout listeners
on the tr elements (or some element within them) that will trigger the
infowindow to open.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
jgee...@mchsi.com

Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!

Mike Williams

unread,
Sep 8, 2009, 12:02:52 PM9/8/09
to Google AJAX APIs

stewamax

unread,
Sep 8, 2009, 5:13:27 PM9/8/09
to Google AJAX APIs
Thanks Mike - looks good
Max
Reply all
Reply to author
Forward
0 new messages