class LabeledMarker

This class extends the Maps API's standard GMarker class with the ability to support markers with textual labels.

Constructor

Constructor Description
LabeledMarker(latlng, opts?) Creates a marker at point with options specified in LabeledMarkerOptions (extension of GMarkerOptions). By default markers are clickable & have the default icon G_DEFAULT_ICON.

Methods

Constructor Methods Description
setLabelVisibility(visibility) none Sets the visibility of the label, which will be respected during show/hides. If marker is visible when set, it will show or hide label appropriately.
getLabelVisibility() Boolean Returns true if label visibility is set on, and false otherwise.
showLabel() none Shows the label of the marker.
hideLabel() none Hides the label of the marker. Note that this does not persist after a marker hide/show.

class LabeledMarkerOptions

Instances of this class are used in the opts? argument to the constructor of the LabeledMarker class. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal. This is an extension of GMarkerOptions. At this time, the draggable property is not supported by LabeledMarker.

Properties

As the name of this class indicates, all properties are optional.

Properties Type Description
labelText String Text to place on top of the marker.
labelClass String Name of CSS class that defines style of label div. Default is "LabeledMarker_markerLabel".
labelOffset GSize The x- and y-distance between the marker's GLatLng and the upper-left corner of the text div.