Class DivLayer

All Implemented Interfaces:
ContainerLayer<DivLayer>

public class DivLayer extends Layer<DivLayer> implements ContainerLayer<DivLayer>
This class represent a Div to be placed on the map. This class is not part of the map's coordinate system. It is a part of the map's enclosing container and you can place it in the container, anchored to one of its corners. Add further components to the DivLayer component by using the methods of the ContainerLayer class.
Since:
4.0
  • Constructor Details

    • DivLayer

      public DivLayer(String name)
      Creates a DivLayer instance.
      Parameters:
      name - DivLayer unique name
      Throws:
      NullPointerException - Thrown if the value of the name parameter is null
  • Method Details

    • setComponent

      protected void setComponent(com.jbstrap.ui.Component<JBMap> component)
      Passes the JBMap component to the DivLayer class instance.
      Parameters:
      component - The JBMap component
    • getParams

      protected com.jbstrap.core.Parameters getParams()
      Gets the parameters of the DivLayer instance.
      Returns:
      DivLayer parameters
    • getName

      public String getName()
      Gets the DivLayer's unique name. Use this name to identify a DivLayer. Two DivLayers cannot have the same name.
      Returns:
      Unique DivLayer name
    • getWidth

      public Integer getWidth()
      Gets the DivLayer height.
      Returns:
      DivLayer width value
    • setWidth

      public DivLayer setWidth(Integer width)
      Sets the DivLayer height.
      Parameters:
      width - DivLayer width in pixels or null; 0 for automatic setting Default: null.
      Returns:
      DivLayer instance
    • getHeight

      public Integer getHeight()
      Gets the DivLayer's height.
      Returns:
      DivLayer height
    • setHeight

      public DivLayer setHeight(Integer height)
      Sets the DivPoint height.
      Parameters:
      height - DivLayer height in pixels or null; 0 for the automatic setting Default: null.
      Returns:
      DivLayer instance
    • getAlign

      public DivLayerAlign getAlign()
      Gets the DivLayer’s layout.
      Returns:
      DivLayer alignment DivLayerAlign
      See Also:
    • setAlign

      public DivLayer setAlign(DivLayerAlign divLayerAlign)
      Sets the DivLayer’s layout.
      Parameters:
      divLayerAlign - DivLayer alignment The available list of enums is: DivLayerAlign. Default value DivLayerAling.TOP_RIGHT
      Returns:
      DivLayer instance
    • getHtml

      public String getHtml()
      Gets the DivLayer's HTML content.
      Returns:
      DivLayer HTML content
    • getBgColor

      public String getBgColor()
      Gets the DivLayer's background color.
      Returns:
      DivLayer background color Default value "rgba(255, 255, 255, .8)"
    • setBgColor

      public DivLayer setBgColor(String fillColor)
      Sets the DivLayer's border color. You can use any standard CSS3 color.
      Parameters:
      fillColor - DivLayer background color Default value "rgba(255, 255, 255, .8)"
      Returns:
      DivLayer instance
    • getBorderColor

      public String getBorderColor()
      Gets the DivLayer's border color.
      Returns:
      DivLayer border color Default value "rgba(0,0,0,0.2)"
    • setBorderColor

      public DivLayer setBorderColor(String color)
      Sets the DivLayer's border color. You can use any standard CSS3 color.
      Parameters:
      color - DivLayer border color Default value "rgba(0,0,0,0.2)"
      Returns:
      DivLayer instance
    • getBorderRadius

      public int getBorderRadius()
      Gets the DivLayer's border radius.
      Returns:
      DivLayer border radius Default value 5
    • setBorderRadius

      public DivLayer setBorderRadius(int radius)
      Sets the DivLayer's border radius.
      Parameters:
      radius - DivLayer border radius Default value 5
      Returns:
      DivLayer instance
    • getBorderStyle

      public BorderStyle getBorderStyle()
      Gets the DivLayer border style.
      Returns:
      DivLayer border style BorderStyle Default value BorderStyle.SOLID
    • setBorderStyle

      public DivLayer setBorderStyle(BorderStyle borderStyle)
      Sets the DivLayer border style.
      Parameters:
      borderStyle - DivLayer border style The available list of enums is: BorderStyle. Default value BorderStyle.SOLID
      Returns:
      DivLayer instance
    • getBorderLineWidth

      public int getBorderLineWidth()
      Gets the DivLayer border width.
      Returns:
      DivLayer border width Default value 1
    • setBorderLineWidth

      public DivLayer setBorderLineWidth(int borderLineWidth)
      Sets the DivLayer border width.
      Parameters:
      borderLineWidth - DivLayer border width Default value 1
      Returns:
      DivLayer instance
    • getLayerOpacity

      public Double getLayerOpacity()
      Gets the DivLayer opacity value.
      Returns:
      DivLayer opacity Default value 1
    • setLayerOpacity

      public DivLayer setLayerOpacity(double opacity)
      Sets the DivLayer opacity value.
      Parameters:
      opacity - DivLayer between 0 and 1. Default value 1
      Returns:
      DivLayer instance
    • getClassName

      public String getClassName()
      Gets a custom CSS class.
      Returns:
      Custom CSS class name
    • setClassName

      public DivLayer setClassName(String className)
      Sets a custom CSS class.
      Parameters:
      className - Custom CSS class name
      Returns:
      DivLayer instance
    • isShadow

      public boolean isShadow()
      Checks if the DivLayer shadow is enabled.
      Returns:
      If true, the shadow is enabled, otherwise not Default value 1
    • setShadow

      public DivLayer setShadow(boolean shadow)
      DivLayer visibility setting.
      Parameters:
      shadow - DivLayer shadow visibility Default value true
      Returns:
      DivLayer instance
    • runJS

      protected void runJS(String script)
      Parameters:
      script - JavaScript
    • draw

      public DivLayer draw()
      Description copied from interface: ContainerLayer
      The layer component content drawing.
      Specified by:
      draw in interface ContainerLayer<DivLayer>
      Returns:
      The layer class instance