All Implemented Interfaces:
Serializable, Evented, Identifiable, LayerPopupFunctions, LayerTooltipFunctions, ExecutableFunctions

public class Popup extends DivOverlay
Used to open popups in certain places of the map. Extends DivOverlay.
See Also:
  • Constructor Details

    • Popup

      public Popup(String content)
      Creates a new popup with the given HTML content and assigns it to the popupPane.
      Parameters:
      content - the HTML content of the popup
  • Method Details

    • getMaxWidth

      public Integer getMaxWidth()
      Returns the maximum width of the popup, in pixels.
      Returns:
      the maximum width of the popup, in pixels
    • setMaxWidth

      public void setMaxWidth(Integer maxWidth)
      Sets the maximum width of the popup, in pixels.
      Parameters:
      maxWidth - the maximum width of the popup, in pixels
    • getMinWidth

      public Integer getMinWidth()
      Returns the minimum width of the popup, in pixels.
      Returns:
      the minimum width of the popup, in pixels
    • setMinWidth

      public void setMinWidth(Integer minWidth)
      Sets the minimum width of the popup, in pixels.
      Parameters:
      minWidth - the minimum width of the popup, in pixels
    • getMaxHeight

      public Integer getMaxHeight()
      Returns the maximum height of the popup, in pixels. If set, a scrollbar is shown when the content exceeds this height.
      Returns:
      the maximum height of the popup, in pixels
    • setMaxHeight

      public void setMaxHeight(Integer maxHeight)
      Sets the maximum height of the popup, in pixels. If set, a scrollbar is shown when the content exceeds this height.
      Parameters:
      maxHeight - the maximum height of the popup, in pixels
    • isAutoPan

      public boolean isAutoPan()
      Returns whether the map is panned when the popup is opened so it does not overlap the map borders.
      Returns:
      true if the map is panned to fit the popup, false otherwise
    • setAutoPan

      public void setAutoPan(boolean autoPan)
      Sets whether the map is panned when the popup is opened so it does not overlap the map borders.
      Parameters:
      autoPan - true to pan the map to fit the popup, false otherwise
    • getAutoPanPaddingTopLeft

      public Point getAutoPanPaddingTopLeft()
      Returns the top-left padding kept between the popup and the map borders during auto-panning.
      Returns:
      the top-left auto-pan padding, in pixels
    • setAutoPanPaddingTopLeft

      public void setAutoPanPaddingTopLeft(Point autoPanPaddingTopLeft)
      Sets the top-left padding kept between the popup and the map borders during auto-panning.
      Parameters:
      autoPanPaddingTopLeft - the top-left auto-pan padding, in pixels
    • getAutoPanPaddingBottomRight

      public Point getAutoPanPaddingBottomRight()
      Returns the bottom-right padding kept between the popup and the map borders during auto-panning.
      Returns:
      the bottom-right auto-pan padding, in pixels
    • setAutoPanPaddingBottomRight

      public void setAutoPanPaddingBottomRight(Point autoPanPaddingBottomRight)
      Sets the bottom-right padding kept between the popup and the map borders during auto-panning.
      Parameters:
      autoPanPaddingBottomRight - the bottom-right auto-pan padding, in pixels
    • getAutoPanPadding

      public Point getAutoPanPadding()
      Returns the padding kept between the popup and the map borders during auto-panning. Equivalent to setting both top-left and bottom-right padding to the same value.
      Returns:
      the auto-pan padding, in pixels
    • setAutoPanPadding

      public void setAutoPanPadding(Point autoPanPadding)
      Sets the padding kept between the popup and the map borders during auto-panning. Equivalent to setting both top-left and bottom-right padding to the same value.
      Parameters:
      autoPanPadding - the auto-pan padding, in pixels
    • isKeepInView

      public boolean isKeepInView()
      Returns whether the popup is kept in view by panning the map when it is about to leave the visible area.
      Returns:
      true if the popup is kept in view, false otherwise
    • setKeepInView

      public void setKeepInView(boolean keepInView)
      Sets whether the popup is kept in view by panning the map when it is about to leave the visible area.
      Parameters:
      keepInView - true to keep the popup in view, false otherwise
    • isCloseButton

      public boolean isCloseButton()
      Returns whether a close button is shown in the popup.
      Returns:
      true if a close button is shown, false otherwise
    • setCloseButton

      public void setCloseButton(boolean closeButton)
      Sets whether a close button is shown in the popup.
      Parameters:
      closeButton - true to show a close button, false otherwise
    • isAutoClose

      public boolean isAutoClose()
      Returns whether the popup is automatically closed when another popup is opened.
      Returns:
      true if the popup closes automatically, false otherwise
    • setAutoClose

      public void setAutoClose(boolean autoClose)
      Sets whether the popup is automatically closed when another popup is opened.
      Parameters:
      autoClose - true to close the popup automatically, false otherwise
    • isCloseOnEscapeKey

      public boolean isCloseOnEscapeKey()
      Returns whether the popup is closed when the escape key is pressed.
      Returns:
      true if the popup closes on the escape key, false otherwise
    • setCloseOnEscapeKey

      public void setCloseOnEscapeKey(boolean closeOnEscapeKey)
      Sets whether the popup is closed when the escape key is pressed.
      Parameters:
      closeOnEscapeKey - true to close the popup on the escape key, false otherwise
    • isCloseOnClick

      public boolean isCloseOnClick()
      Returns whether the popup is closed when the map is clicked.
      Returns:
      true if the popup closes on map click, false otherwise
    • setCloseOnClick

      public void setCloseOnClick(boolean closeOnClick)
      Sets whether the popup is closed when the map is clicked.
      Parameters:
      closeOnClick - true to close the popup on map click, false otherwise