Class CustomPopup


public class CustomPopup extends Popup
A popup with user defined handler. The handler is responsible
for drawing the bitmap for the popup and can also respond to
touch event.
  • Constructor Details

    • CustomPopup

      public CustomPopup(Billboard baseBillboard, PopupStyle style, CustomPopupHandler popupHandler)
      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

      public CustomPopup(Geometry geometry, PopupStyle style, CustomPopupHandler popupHandler)
      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

      public CustomPopup(MapPos pos, PopupStyle style, CustomPopupHandler popupHandler)
      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

      public CustomPopupHandler getPopupHandler()
      Returns the handler used for the popup.
      Returns:
      The popup handler responsible for drawing the popup and handling click events.
    • processClick

      public boolean processClick(ClickInfo clickInfo, MapPos clickPos, ScreenPos elementClickPos)
      Description copied from class: Popup
      Handles the click events for this Popup.
      Overrides:
      processClick in class Popup
      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: 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.
      Overrides:
      drawBitmap in class Popup
      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.