public

InfoBubble(data, params, callback)Method

Description

Creates an infoBubble according to the parameters required and return it to a callback function.

Parameters

Type Name Description
Object data Data object containing the data for display in the infoBubble
String data.name Data for the title
String [data.description] Data for the second line of text. Frequently an address
String [data.more] Data for the third line of text.
Number [data.ratingValue] Number of rating stars to be shown . values: [0.0, 0.5, 1.0, ... , 4.5, 5.0]
Object params params of the infoBubble to create
Array [params.content] List of "children" elements which are to be shown in the infoBubble (if data is present) possible values are ["title", "description", "more", "rating"]
Number [params.maxWidth] If not given, the bubble will be as big as it needs to be. If given, the maximum width of the bubble. It will always be as small as possible, though
String | Image [params.left] A string which can resolve to the src of an image. Or a javascript image element
Boolean [params.leftDelimiter] If it's true a delimiter will be drawn between the left image and the middle part
String | Image [params.right] A string which can resolve to the src of an image. Or a javascript image element
Boolean [params.rightDelimiter] If it's true a delimiter will be drawn between the middle part and the right image
HTMLCanvasElement [params.image] A canvas image to be placed in the middle of the infoBubble. Not compatible with any of the above
Object [params.listeners]
Function [params.listeners.click] The function to be called when the infoBubble is clicked
Function [params.listeners.leftclick] If there is a params.left image specified, this function will be called when the vertical left portion of the infoBubble is clicked. The vertical left portion is everything up to, but not including the divider line, if it is present. The params.listeners.click event will not be fired.
Function [params.listeners.rightclick] As above. But on the right vertical third of the infoBubble
String [params.background] a string in the format: "rgb(200,0,0)" (solid red) or "rgba(0, 0, 200, 0.5)" (blue with 50% transparency)
Number [params.borderRadius] degree of curviness of the corners
Number [params.parent] parent control of the infoBubble
Function [callback] The function called when the infoBubble has been created. It receives the infoBubble object as a parameter.