views:

147

answers:

2

I'm trying to work out how Google adds images and styling to their tooltips that appear over markers in google maps.

An example of the desired behaviour can be seen here:

http://maps.google.es/maps?oe=utf-8&q=hotels+in+sydney

If you mouseover one of the hotel markers, you will see different styles (bold text, normal text), paragraphs or line breaks, and images for the star-rating of the hotel. As far as I can see from the docs, these tooltips are created by giving each marker a 'title' attribute... however, any HTML in this attribute is escaped; you might end up with a tooltip that looks like:

<p class="tooltip-text">This doesn't work!</p> <image src="/images/myimage.png" />

... which is not the desired outcome.

Anyone have any ideas?

A: 

Look at this example. It shows tooltips in custom design. But i'm not sure if it works with v3 API. However i think method used in that example will be work with v3 too.

antyrat
Well... thats kinda what I was trying to avoid doing... creating a custom overlay and binding to the mouseover / mouseout events to show / hide it. The API already provides a way of doing tooltips, why do I have to reinvent it? It appears to me that google is using the 'normal', title-based tooltips in the example above.However, if there is no other alternative, thanks for the example page =).
Josh
A: 

Check out these tools. There's and infobox customization which pretty much replaces the default one but retains all it's properties. Hope it helps!

Landitus
I guess you both answered my question... ie. you DO need to create your own overlay. But those libraries are pretty nice!
Josh