Google Maps API Tutorial - Tooltips

© 2006, 2007,2008, 2009 Mike Williams

 
Translate this page:

 

Standard Tooltips

It's possible to add tooltips to your markers.

Here's an example

The preferred syntax for GMarker() allows a set of options to be specified. One of these options is "title", which specifies the tooltip text.

E.g. new GMarker(point, {title:"My House"});

These types of tooltip are plain text. You can't apply any formatting to them. If you want to change the style, position or duration you'll need to use custom tooltips.

Potential Pitfalls

  1. Don't try to mix this syntax with the old GMarker() syntax

    This won't work: new GMarker(point, myIcon, {title:"My House"}). When you use the new syntax, the options must be the second parameter, like this new GMarker(point, {icon:myIcon, title:"My House"}).

Back to Mike's Homepage
Up to the start of this tutorial