Package com.jbstrap.jbmap.layers.layer
Class PointImage
java.lang.Object
com.jbstrap.jbmap.layers.layer.PointImage
This class represents an image that you can add to a
Point
layer or a LayerGroup
.- Since:
- 4.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the custom CSS class assigned to the PointImage.Gets the anchor (offset coordinates relative to the Point).Gets the horizontal anchor (offset coordinates relative to the Point).Gets the vertical anchor (offset coordinates relative to the Point).Gets the image height.Gets the image size.Gets the PointImage URL.Gets the image width.getName()
Gets the PointImage's unique name.final com.jbstrap.core.Parameters
Gets the PointImage parameters.Gets the popup anchor (offset coordinates relative to the Point).int
Gets the horizontal popup anchor (offset coordinates relative to the Point).int
Gets the vertical popup anchor (offset coordinates relative to the Point).Gets the anchor (offset coordinates relative to the Point).Gets the horizontal anchor (offset coordinates relative to the Point).Gets the vertical anchor (offset coordinates relative to the Point).Gets the image shadow height.Gets the image shadow size.Gets the image shadow URL.Gets the image shadow width.Gets the tooltip anchor (offset coordinates relative to the Point).int
Gets the horizontal tooltip anchor (offset coordinates relative to the Point).int
Gets the vertical tooltip anchor (offset coordinates relative to the Point).protected void
setClassName
(String className) Adds a custom CSS to the PointImage.setImageAnchor
(Integer x, Integer y) Sets the anchor (offset coordinates relative to the Point).setImageSize
(Integer width, Integer height) Sets the image size.setImageUrl
(String imageUrl) Sets the PointImage URL.protected void
setPopupAnchor
(int x, int y) Sets the popup anchor (offset coordinates relative to the Point).setShadowAnchor
(Integer x, Integer y) Sets the anchor (offset coordinates relative to the Point).setShadowSize
(Integer width, Integer height) Sets the image shadow size.setShadowUrl
(String shadowUrl) Sets the image shadow URL.setTooltipAnchor
(int x, int y) Gets the tooltip anchor (offset coordinates relative to the Point).
-
Constructor Details
-
PointImage
Creates a PointImage instance.- Parameters:
name
- The unique ID of the image- Throws:
NullPointerException
- Thrown if the value of thename
orimageUrl
parameter isnull
-
-
Method Details
-
setPoint
-
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
Gets the PointImage URL.- Returns:
- PointImage URL
-
setImageUrl
Sets the PointImage URL.- Parameters:
imageUrl
- PointImage URL- Returns:
- PointImage class instance
-
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
Gets the image width.- Returns:
- Image width
-
getImageHeight
Gets the image height.- Returns:
- Image height
-
setImageSize
Sets the image size. If not specified, the image is displayed in its original size.- Parameters:
width
- Image width in pixelsheight
- Image height in pixels- Returns:
- PointImage class instance
-
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
Gets the horizontal anchor (offset coordinates relative to the Point).- Returns:
- Horizontal anchor
-
getImageAnchorY
Gets the vertical anchor (offset coordinates relative to the Point).- Returns:
- Vertical anchor
-
setImageAnchor
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 coordinatesy
- Vertical offset in pixels, calculated from the point designated with the coordinates- Returns:
- PointImage class instance
-
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
Gets the tooltip anchor (offset coordinates relative to the Point).- Parameters:
x
- Horizontal offset in pixelsy
- Vertical offset in pixels- Returns:
- PointImage class instance
-
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
Sets the popup anchor (offset coordinates relative to the Point).- Parameters:
x
- Horizontal offset in pixelsy
- Vertical offset in pixels- Returns:
- PointImage class instance
-
getShadowUrl
Gets the image shadow URL.- Returns:
- Image shadow URL
-
setShadowUrl
Sets the image shadow URL.- Parameters:
shadowUrl
- Image shadow URL- Returns:
- PointImage class instance
-
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
Gets the image shadow width.- Returns:
- Image shadow width
-
getShadowHeight
Gets the image shadow height.- Returns:
- Image shadow height
-
setShadowSize
Sets the image shadow size. If not specified, the image is displayed in its original size.- Parameters:
width
- Image shadow width in pixelsheight
- Image shadow height in pixels- Returns:
- PointImage class instance
-
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
Gets the horizontal anchor (offset coordinates relative to the Point).- Returns:
- Horizontal anchor
-
getShadowAnchorY
Gets the vertical anchor (offset coordinates relative to the Point).- Returns:
- Vertical anchor
-
setShadowAnchor
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 coordinatesy
- Vertical offset in pixels, calculated from the point designated with the coordinates- Returns:
- PointImage class instance
-
getClassName
Gets the custom CSS class assigned to the PointImage.- Returns:
- PointImage custom CSS class
-
setClassName
Adds a custom CSS to the PointImage.- Parameters:
className
- Custom CSS class- Returns:
- PointImage class instance
-
runJS
- Parameters:
script
- JavaScript
-