Class PointImage

java.lang.Object
com.jbstrap.jbmap.layers.layer.PointImage

public class PointImage extends Object
This class represents an image that you can add to a Point layer or a LayerGroup.
Since:
4.0
  • Constructor Details

    • PointImage

      public PointImage(String name, String imageUrl)
      Creates a PointImage instance.
      Parameters:
      name - The unique ID of the image
      Throws:
      NullPointerException - Thrown if the value of the name or imageUrl parameter is null
  • Method Details

    • setPoint

      protected void setPoint(Point point)
    • getName

      public String getName()
      Gets the PointImage's unique name.
      Returns:
      The unique PointImage name
    • getParams

      public final com.jbstrap.core.Parameters getParams()
      Gets the PointImage parameters.
      Returns:
      PointImage parameters
    • getImageUrl

      public String getImageUrl()
      Gets the PointImage URL.
      Returns:
      PointImage URL
    • setImageUrl

      public PointImage setImageUrl(String imageUrl)
      Sets the PointImage URL.
      Parameters:
      imageUrl - PointImage URL
      Returns:
      PointImage class instance
    • getImageSize

      public List<Integer> getImageSize()
      Gets the image size.
      Returns:
      A list containing the map's width and height values In the list, the first item is width and the second one is height.
    • getImageWidth

      public Integer getImageWidth()
      Gets the image width.
      Returns:
      Image width
    • getImageHeight

      public Integer getImageHeight()
      Gets the image height.
      Returns:
      Image height
    • setImageSize

      public PointImage setImageSize(Integer width, Integer height)
      Sets the image size. If not specified, the image is displayed in its original size.
      Parameters:
      width - Image width in pixels
      height - Image height in pixels
      Returns:
      PointImage class instance
    • getImageAnchor

      public List<Integer> getImageAnchor()
      Gets the anchor (offset coordinates relative to the Point).
      Returns:
      Horizontal and vertical anchor In the list, the first item is X and the second one is Y.
    • getImageAnchorX

      public Integer getImageAnchorX()
      Gets the horizontal anchor (offset coordinates relative to the Point).
      Returns:
      Horizontal anchor
    • getImageAnchorY

      public Integer getImageAnchorY()
      Gets the vertical anchor (offset coordinates relative to the Point).
      Returns:
      Vertical anchor
    • setImageAnchor

      public PointImage setImageAnchor(Integer x, Integer y)
      Sets the anchor (offset coordinates relative to the Point). If left unspecified, the default setting is that the image's horizontal offset is equal to the image width (to the left) and the vertical offset is equal to the image height (upwards).
      Parameters:
      x - Horizontal offset in pixels, calculated from the point designated with the coordinates
      y - Vertical offset in pixels, calculated from the point designated with the coordinates
      Returns:
      PointImage class instance
    • getTooltipAnchor

      public List<Integer> getTooltipAnchor()
      Gets the tooltip anchor (offset coordinates relative to the Point).
      Returns:
      Horizontal and vertical anchor In the list, the first item is X and the second one is Y.
    • getTooltipAnchorX

      public int getTooltipAnchorX()
      Gets the horizontal tooltip anchor (offset coordinates relative to the Point).
      Returns:
      Horizontal anchor
    • getTooltipAnchorY

      public int getTooltipAnchorY()
      Gets the vertical tooltip anchor (offset coordinates relative to the Point).
      Returns:
      Vertical anchor
    • setTooltipAnchor

      public PointImage setTooltipAnchor(int x, int y)
      Gets the tooltip anchor (offset coordinates relative to the Point).
      Parameters:
      x - Horizontal offset in pixels
      y - Vertical offset in pixels
      Returns:
      PointImage class instance
    • getPopupAnchor

      public List<Integer> getPopupAnchor()
      Gets the popup anchor (offset coordinates relative to the Point).
      Returns:
      Horizontal and vertical anchor In the list, the first item is X and the second one is Y.
    • getPopupAnchorX

      public int getPopupAnchorX()
      Gets the horizontal popup anchor (offset coordinates relative to the Point).
      Returns:
      Horizontal anchor
    • getPopupAnchorY

      public int getPopupAnchorY()
      Gets the vertical popup anchor (offset coordinates relative to the Point).
      Returns:
      Vertical anchor
    • setPopupAnchor

      public PointImage setPopupAnchor(int x, int y)
      Sets the popup anchor (offset coordinates relative to the Point).
      Parameters:
      x - Horizontal offset in pixels
      y - Vertical offset in pixels
      Returns:
      PointImage class instance
    • getShadowUrl

      public String getShadowUrl()
      Gets the image shadow URL.
      Returns:
      Image shadow URL
    • setShadowUrl

      public PointImage setShadowUrl(String shadowUrl)
      Sets the image shadow URL.
      Parameters:
      shadowUrl - Image shadow URL
      Returns:
      PointImage class instance
    • getShadowSize

      public List<Integer> getShadowSize()
      Gets the image shadow size.
      Returns:
      A list containing the image shadow's width and height values In the list, the first item is width and the second one is height.
    • getShadowWidth

      public Integer getShadowWidth()
      Gets the image shadow width.
      Returns:
      Image shadow width
    • getShadowHeight

      public Integer getShadowHeight()
      Gets the image shadow height.
      Returns:
      Image shadow height
    • setShadowSize

      public PointImage setShadowSize(Integer width, Integer height)
      Sets the image shadow size. If not specified, the image is displayed in its original size.
      Parameters:
      width - Image shadow width in pixels
      height - Image shadow height in pixels
      Returns:
      PointImage class instance
    • getShadowAnchor

      public List<Integer> getShadowAnchor()
      Gets the anchor (offset coordinates relative to the Point).
      Returns:
      Horizontal and vertical anchor In the list, the first item is X and the second one is Y.
    • getShadowAnchorX

      public Integer getShadowAnchorX()
      Gets the horizontal anchor (offset coordinates relative to the Point).
      Returns:
      Horizontal anchor
    • getShadowAnchorY

      public Integer getShadowAnchorY()
      Gets the vertical anchor (offset coordinates relative to the Point).
      Returns:
      Vertical anchor
    • setShadowAnchor

      public PointImage setShadowAnchor(Integer x, Integer y)
      Sets the anchor (offset coordinates relative to the Point). If left unspecified, the default setting is that the image shadow's horizontal offset is equal to the image width (to the left) and the vertical offset is equal to the image height (upwards).
      Parameters:
      x - Horizontal offset in pixels, calculated from the point designated with the coordinates
      y - Vertical offset in pixels, calculated from the point designated with the coordinates
      Returns:
      PointImage class instance
    • getClassName

      public String getClassName()
      Gets the custom CSS class assigned to the PointImage.
      Returns:
      PointImage custom CSS class
    • setClassName

      public PointImage setClassName(String className)
      Adds a custom CSS to the PointImage.
      Parameters:
      className - Custom CSS class
      Returns:
      PointImage class instance
    • runJS

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