Sunday, October 3, 2010

[Google Maps API v2] Re: Adding ToolTips to Markers

> I checked the code to my map:
> http://www.wohva-map-catalog.org/
> and don't see "new GMarker(latlng," anywhere on my page so I'm lost as
> to where to add the tooltip.

But you have identified that
      var marker = new GMarker(point);
is somewhat similar. This is where some javascript experience helps
when using the maps API.
In general terms, GMarker(point) is equivalent to GMarker(banana) is
equivalent to GMarker(any_variable_name_you_like). The name that you
choose to use for a variable is pretty unimportant.

In the other thread, the advice was given as an example
new GMarker(latlng, {title:"Tooltip text"})
in your case you have
new GMarker(point)
as a part of one line ; to make it like the example you would use
new GMarker(point, {title:"Tooltip text"} )

A more realistic example might look like
var tooltipText = "Some wordies" ;
var marker = new GMarker(point, {title: tooltipText} );
using normal javascript variable-substitution

Have you seen this invaluable resource?
http://econym.org.uk/gmap/
see in particular
http://econym.org.uk/gmap/tooltips.htm

--
You received this message because you are subscribed to the Google Groups "Google Maps API V2" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate