Package com.massifmaps.vectorelements
Class CustomPopup
java.lang.Object
com.massifmaps.vectorelements.VectorElement
com.massifmaps.vectorelements.Billboard
com.massifmaps.vectorelements.Popup
com.massifmaps.vectorelements.CustomPopup
A popup with user defined handler. The handler is responsible
for drawing the bitmap for the popup and can also respond to
touch event.
for drawing the bitmap for the popup and can also respond to
touch event.
-
Constructor Summary
ConstructorsConstructorDescriptionCustomPopup(MapPos pos, PopupStyle style, CustomPopupHandler popupHandler) Constructs a CustomPopup object from a map position and a style.CustomPopup(Geometry geometry, PopupStyle style, CustomPopupHandler popupHandler) Constructs a CustomPopup object from a geometry object and a style.CustomPopup(Billboard baseBillboard, PopupStyle style, CustomPopupHandler popupHandler) Constructs a CustomPopup object with the specified style and attaches it to a billboard element. -
Method Summary
Modifier and TypeMethodDescriptiondrawBitmap(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.
The method is called each time the Popup gets reloaded internally.Returns the handler used for the popup.booleanprocessClick(ClickInfo clickInfo, MapPos clickPos, ScreenPos elementClickPos) Handles the click events for this Popup.Methods inherited from class com.massifmaps.vectorelements.Popup
getAnchorPointX, getAnchorPointY, getStyle, setAnchorPoint, setAnchorPointX, setAnchorPointY, setStyleMethods inherited from class com.massifmaps.vectorelements.Billboard
getBaseBillboard, getBounds, getGeometry, getRootGeometry, getRotation, setBaseBillboard, setGeometry, setPos, setRotationMethods inherited from class com.massifmaps.vectorelements.VectorElement
containsMetaDataKey, equals, getId, getMetaData, getMetaDataElement, hashCode, isVisible, notifyElementChanged, setId, setMetaData, setMetaDataElement, setVisible
-
Constructor Details
-
CustomPopup
Constructs a CustomPopup object with the specified style and attaches it to a billboard element.- Parameters:
baseBillboard- The billboard this popup will be attached to.style- The style that defines what this popup looks like.popupHandler- The handler to use for the popup.
-
CustomPopup
Constructs a CustomPopup object from a geometry object and a style.- Parameters:
geometry- The geometry object that defines the location of this popup.style- The style that defines what this popup looks like.popupHandler- The handler to use for the popup.
-
CustomPopup
Constructs a CustomPopup object from a map position and a style.- Parameters:
pos- The map position that defines the location of this popup.style- The style that defines what this popup looks like.popupHandler- The handler to use for the popup.
-
-
Method Details
-
getPopupHandler
Returns the handler used for the popup.- Returns:
- The popup handler responsible for drawing the popup and handling click events.
-
processClick
Description copied from class:PopupHandles the click events for this Popup.- Overrides:
processClickin classPopup- Parameters:
clickInfo- The click attributes.clickPos- The position of the click.elementClickPos- The 2D position of the click on the popup.- Returns:
- True if the click was handled. False otherwise.
-
drawBitmap
public Bitmap drawBitmap(ScreenPos anchorScreenPos, float screenWidth, float screenHeight, float dpToPX) Description copied from class:PopupDraws 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.- Overrides:
drawBitmapin classPopup- Parameters:
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 custom Popup bitmap.
-