java.lang.Object | ||||
↳ | com.carto.vectorelements.VectorElement | |||
↳ | com.carto.vectorelements.Billboard | |||
↳ | com.carto.vectorelements.Popup | |||
↳ | com.carto.vectorelements.BalloonPopup |
A highly configurable popup implementation that allows the user to specify a title, description, colors, images, font sizes etc.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BalloonPopup(Billboard baseBillboard, BalloonPopupStyle style, String title, String desc)
Constructs a BalloonPopup object with the specified style and attaches it to a billboard element.
| |||||||||||
BalloonPopup(Geometry geometry, BalloonPopupStyle style, String title, String desc)
Constructs a BalloonPopup object from a geometry object and a style.
| |||||||||||
BalloonPopup(MapPos pos, BalloonPopupStyle style, String title, String desc)
Constructs a BalloonPopup object from a map position and a style.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addButton(BalloonPopupButton button)
Adds a new button to the balloon popup.
| ||||||||||
void |
clearButtons()
Removes all buttons from the balloon popup.
| ||||||||||
synchronized void | delete() | ||||||||||
Bitmap |
drawBitmap(ScreenPos anchorScreenPos, float screenWidth, float screenHeight, float dpToPX)
Draws a custom bitmap for this Popup that will be used for drawing the Popup on the map.
| ||||||||||
BalloonPopupEventListener |
getBalloonPopupEventListener()
Returns the balloon popup event listener.
| ||||||||||
String |
getDescription()
Returns the description of this balloon popup.
| ||||||||||
BalloonPopupStyle |
getStyle()
Returns the style of this balloon popup.
| ||||||||||
String |
getTitle()
Returns the title of this balloon popup.
| ||||||||||
boolean |
processClick(ClickType clickType, MapPos clickPos, ScreenPos elementClickPos)
Handles the click events for this Popup.
| ||||||||||
void |
removeButton(BalloonPopupButton button)
Removes a button from the balloon popup.
| ||||||||||
void |
replaceButton(BalloonPopupButton oldButton, BalloonPopupButton newButton)
Replaces an old baloon popup button with a new button.
| ||||||||||
void |
setBalloonPopupEventListener(BalloonPopupEventListener eventListener)
Sets the balloon popup event listener.
| ||||||||||
void |
setDescription(String desc)
Sets the description this balloon popup will display.
| ||||||||||
void |
setStyle(BalloonPopupStyle style)
Sets the style for this balloon popup.
| ||||||||||
void |
setTitle(String title)
Sets the title this balloon popup will display.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructs a BalloonPopup object with the specified style and attaches it to a billboard element.
If an empty string is passed for the title, it will not be drawn. The same applies to the description.
baseBillboard | The billboard this balloon popup will be attached to. |
---|---|
style | The style that defines what this balloon popup looks like. |
title | The text this balloon popup will display. |
desc | The description this balloon popup will display. |
Constructs a BalloonPopup object from a geometry object and a style.
If an empty string is passed for the title, it will not be drawn. The same applies to the description.
geometry | The geometry object that defines the location of this balloon popup. |
---|---|
style | The style that defines what this balloon popup looks like. |
title | The text this balloon popup will display. |
desc | The description this balloon popup will display. |
Constructs a BalloonPopup object from a map position and a style.
If an empty string is passed for the title, it will not be drawn. The same applies to the description.
pos | The map position that defines the location of this balloon popup. |
---|---|
style | The style that defines what this balloon popup looks like. |
title | The text this balloon popup will display. |
desc | The description this balloon popup will display. |
Adds a new button to the balloon popup.
If the button is already added, the call is ignored.
button | The button object to add. |
---|
Removes all buttons from the balloon popup.
Draws a custom bitmap for this Popup that will be used for drawing the Popup on the map.
The method is called each time the Popup gets reloaded internally.
anchorScreenPos | The screen position of the anchor point of this popup in pixels. |
---|---|
screenWidth | The current screen width in pixels. |
screenHeight | The current screen height in pixels. |
dpToPX | The value used for converting display independent pixels (dp) to pixels (px). |
Returns the balloon popup event listener.
Returns the description of this balloon popup.
Returns the style of this balloon popup.
Returns the title of this balloon popup.
Handles the click events for this Popup.
clickType | The type of the click. |
---|---|
clickPos | The position of the click. |
elementClickPos | The 2D position of the click on the popup. |
Removes a button from the balloon popup.
If the button is not present, the call is ignored.
button | The button object to remove. |
---|
Replaces an old baloon popup button with a new button.
oldButton | The old button to replace. |
---|---|
newButton | The new button. |
Sets the balloon popup event listener.
eventListener | The balloon popup event listener. |
---|
Sets the description this balloon popup will display. If an empty string is passed
the description will not be drawn.
desc | The new description this balloon popup will display. |
---|
Sets the style for this balloon popup.
style | The new style that defines what this balloon popup looks like. |
---|
Sets the title this balloon popup will display. If an empty string is passed
the title will not be drawn.
title | The new title this balloon popup will display. |
---|