PopupMarker

This library displays a "popup" (mini infowindow) to the side of a marker. There are two types of popups that this library can create for you. The first is a simple popup that can render text or HTML, but its background color cheme cannot be changed. The second type of popup is generated using the Google Charts API, and can show text and icons, with any desired color scheme. Since the second popup effectively re-generates an image anytime its options are changed, it's not recommended for use in situations where you want to animate the content of the popup at a fast rate. The popup types are chosen based on the value of "type" in the options.

For a description and examples of how to use this library, check out the how-to.

class PopupMarker

Constructor

Constructor Description
PopupMarker(latlng:GLatLng, opts?:PopupMarkerOptions) Creates a marker with options specified in PopupMarkerOptions (extension of GMarkerOptions). Creates a popup and then calls the GMarker constructor.

Methods

Methods Return Value Description
hide() None Hides the marker and popup.
hidePopup() None Hides the popup.
setChartBgColor(bgColor:String) None Sets the background color. If the style property not set to "chart", then this property is ignored.
setChartIcon(iconName:String) None Sets the icon name. If the style property not set to "chart", then this property is ignored.
setChartStyle(styleName:String) None Sets the chart style. If the style property not set to "chart", then this property is ignored.
setChartTextColor(textColor:String) None Sets the text color. If the style property not set to "chart", then this property is ignored.
setText(message:Strings) None Set the text of the popup message.
show() None Shows the marker. Note that this method shows only the marker. If you want to show marker and the popup, then use the showPopup.
showPopup() None Shows the marker and the popup.

class PopupMarkerChartAPIOptions

This class represents options passed to the chart property in PopupMarkerOptions. It has no constructor, but is instantiated as an object literal. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.

Properties

Properties Type Description
bgColor String Specifies background color as a 6-digit hexadecimal number. The default value is "FFFFFF".
chartStyle String Specifies layout/size. Valid options are "d_bubble_icon_text_small", "d_bubble_icon_text_big", "d_bubble_icon_texts_big", and "d_bubble_texts_big". Those options are shown here. The default value is "".
icon String Specifies an icon name. Valid options are shown here. The default value is "".
textColor String Specifies text color as a 6-digit hexadecimal number. The default value is "000000".

class PopupMarkerOptions

This class represents optional arguments to PopupMarker and GMarker. It has no constructor, but is instantiated as an object literal. There is no constructor for this class. Instead, this class is instantiated as a javascript object literal.

Properties

Properties Type Description
chart PopupMarkerChartAPIOptions This property specifies various customization options for the Charts API output. If the style property is not set to "chart", then this property is ignored. The default value is {}.
style String Specifies style of popup. If set to "chart", then this library shows the popup using the output of the Google Chart API, and additional options should be specified in the chart property. The default value is "normal".
text String Specifies the text shown in the popup. If the style property is set to "chart", then this string must follow the format for text in the Google Charts API. The default value is "".