google's marker tooltip for custom overlays

830 views
Skip to first unread message

helen

unread,
Jan 20, 2011, 1:36:43 PM1/20/11
to google-map...@googlegroups.com
Hello,
I have both standard markers and some custom ones on my map and I would like my custom markers to have tooltips that look the same as the ones for google's markers. I tried adding a 'title' field to my OverlayView object in hopes that they would be displayed automagically but no such luck. I can write my own but if so, I would like them to look like Google's and I can't seem to find them in the DOM to get the styles. Does anyone have any suggestions for this?
Thanks!

Message has been deleted

Martin

unread,
Jan 20, 2011, 10:55:13 PM1/20/11
to Google Maps JavaScript API v3
Hi.

The tooltips are not part of the HTML DOM they are standard
'application' tooltips.
Same as the tooltips that appear when i hover my mouse over the Home
button in my browser for example.

Mike's page here is about API v2 but it's still relevant for v3:
http://econym.org.uk/gmap/tooltips.htm

[quote]
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.
[/quote]

Adding a title attribute to an HTML image element should work the same
as a marker tooltip i would have thought?

Martin.

Martin Matysiak

unread,
Jan 21, 2011, 2:49:15 AM1/21/11
to google-map...@googlegroups.com
Adding tooltips to custom markers works definitely, I do this, too. I'm using a selfmade lightweight marker class which in fact is a single div-object on the map. When I set the title attribute of this div, it'll be showed as a tooltip on my map (you can see this in my Facebook App (the app itself currently does not work in IE, though, I'm working on this), the code for my marker is here (specifically in line 37)).

helen

unread,
Jan 21, 2011, 11:13:27 AM1/21/11
to google-map...@googlegroups.com
Thank you to both Martins!

I didn't think of trying to add a title attribute to my custom overlays, which are really just a DIV like Martin#2's 'lightweight markers', I guess because I was thinking they were special google map's tooltips. I had written some custom tooltips and styled them as closely I could, but this is exactly what I was hoping for.

Helen
Reply all
Reply to author
Forward
0 new messages