LabeledMarker

This library extends the Maps API's standard GMarker class with the ability to support markers with textual labels. Please see articles here:

class LabeledMarker

This class adds the ability to support markers with textual labels. This class extends GMarker.

Constructor

Constructor Description
LabeledMarker(latlng, opt_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

Methods Return Value Description
getLabelVisibility() Boolean Returns whether label visibility is set on.
hideLabel() None Hides the label of the marker.
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.
showLabel() None Shows the label of the marker.

class LabeledMarkerOptions

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

Properties

Properties Type Description
labelClass String Class to use for the overlay div. The default value is "LabeledMarker_markerLabel".
labelOffset GSize The x- and y-distance between the marker's latlng and the upper-left corner of the text div.
labelText String Text to place in the overlay div.