Class Icon
- All Implemented Interfaces:
JsonSerializable
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new icon.Create a new icon.Create a new icon.Create a new icon.Create a new icon.Create a new icon.Create a new icon. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Icon
fromJson
(com.google.gson.JsonObject obj) @Nullable Vector
Get the coordinates of the "tip" of the icon (relative to its top left corner).getImage()
Get the image to use for this icon.getPoint()
Get thePoint
on the map for this icon.@Nullable String
Get the retina sized image to use for this icon.@Nullable Double
Get the rotation angle, in degrees, clockwise.@Nullable String
Get the rotation origin, as a transform-origin CSS rule.@Nullable String
Get shadow image of this icon.@Nullable Vector
Get the coordinates of the "tip" of the shadow image (relative to its top left corner).@Nullable String
Get the retina sized shadow image to use for this icon.@Nullable Vector
Get the size of the shadow image in pixels.@Nullable Vector
getSize()
Get the size of the image, in pixels.int
hashCode()
static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.Set the coordinates of the "tip" of the icon (relative to its top left corner).Set the image to use for this icon.Set a newPoint
on the map for this icon.Set the retina sized image to use for this icon.setRotationAngle
(@Nullable Double rotationAngle) Set the rotation angle, in degrees, clockwise.setRotationOrigin
(@Nullable String rotationOrigin) Set the rotation origin, as a transform-origin CSS rule.Set the shadow image to use for this icon.setShadowAnchor
(@Nullable Vector shadowAnchor) Set the coordinates of the "tip" of the shadow image (relative to its top left corner).setShadowRetina
(@Nullable String shadowRetina) Set the retina sized shadow image to use for this icon.setShadowSize
(@Nullable Vector shadowSize) Set the size of the shadow image in pixels.Set the size of the image, in pixels.com.google.gson.JsonObject
toJson()
Jsonify this object.toString()
Methods inherited from class net.pl3x.map.core.markers.marker.Marker
circle, circle, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, getOptions, getPane, getType, icon, icon, icon, icon, icon, icon, icon, multiPolygon, multiPolygon, multiPolygon, multiPolyline, multiPolyline, multiPolyline, polygon, polygon, polygon, polyline, polyline, polyline, rectangle, rectangle, setOptions, setOptions, setPane
-
Constructor Details
-
Icon
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image key
-
Icon
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image key
-
Icon
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image keysize
- size of image
-
Icon
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image keywidth
- width of imageheight
- height of image
-
Icon
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keysize
- size of image
-
Icon
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keywidth
- width of imageheight
- height of image
-
Icon
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keysize
- size of image
-
-
Method Details
-
of
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image key- Returns:
- a new icon
-
of
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image key- Returns:
- a new icon
-
of
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image keysize
- size of image- Returns:
- a new icon
-
of
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image keywidth
- width of imageheight
- height of image- Returns:
- a new icon
-
of
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keysize
- size of image- Returns:
- a new icon
-
of
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keywidth
- width of imageheight
- height of image- Returns:
- a new icon
-
of
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keysize
- size of image- Returns:
- a new icon
-
getPoint
Get thePoint
on the map for this icon.- Returns:
- point on map
-
setPoint
Set a newPoint
on the map for this icon.- Parameters:
point
- new point on map- Returns:
- this icon
-
getImage
Get the image to use for this icon.- Returns:
- image
- See Also:
-
setImage
Set the image to use for this icon.Key must be registered with the icon registry.
- Parameters:
image
- new image- Returns:
- this icon
- See Also:
-
getRetina
Get the retina sized image to use for this icon.This image will be used on retina devices.
Defaults to '
' if null.getImage()
- Returns:
- retina image
- See Also:
-
setRetina
Set the retina sized image to use for this icon.This image will be used on retina devices.
Key must be registered with the icon registry.
Defaults to '
' if null.getImage()
- Parameters:
retina
- new retina image- Returns:
- this icon
- See Also:
-
getSize
Get the size of the image, in pixels.Used for auto centering the image on '
' if set.getPoint()
- Returns:
- image size
-
setSize
Set the size of the image, in pixels.Used for auto centering the image on '
' if set.getPoint()
- Parameters:
size
- new image size- Returns:
- this icon
-
getAnchor
Get the coordinates of the "tip" of the icon (relative to its top left corner).The icon will be aligned so that this point is at
getPoint()
.Centered by default if '
' is also set.getSize()
- Returns:
- icon anchor
-
setAnchor
Set the coordinates of the "tip" of the icon (relative to its top left corner).The icon will be aligned so that this point is at
getPoint()
.Centered by default if '
' is also set.getSize()
- Parameters:
anchor
- new anchor- Returns:
- this icon
-
getRotationAngle
Get the rotation angle, in degrees, clockwise.Defaults to '
0
' if null.- Returns:
- angle of rotation
-
setRotationAngle
Set the rotation angle, in degrees, clockwise.Defaults to '
0
' if null.- Parameters:
rotationAngle
- angle of rotation- Returns:
- this icon
-
getRotationOrigin
Get the rotation origin, as a transform-origin CSS rule.Defaults to '
bottom center
' if null.- Returns:
- origin of rotation
- See Also:
-
setRotationOrigin
Set the rotation origin, as a transform-origin CSS rule.Defaults to '
bottom center
' if null.- Parameters:
rotationOrigin
- origin of rotation- Returns:
- this icon
- See Also:
-
getShadow
Get shadow image of this icon.No shadow image will be shown, if null.
- Returns:
- shadow image
-
setShadow
Set the shadow image to use for this icon.Key must be registered with the icon registry.
No shadow image will be shown, if null.
- Parameters:
shadow
- new shadow image- Returns:
- this icon
- See Also:
-
getShadowRetina
Get the retina sized shadow image to use for this icon.This shadow image will be used on retina devices.
Key must be registered with the icon registry.
Defaults to '
' if null.getShadow()
- Returns:
- retina shadow image
- See Also:
-
setShadowRetina
Set the retina sized shadow image to use for this icon.This shadow image will be used on retina devices.
Key must be registered with the icon registry.
Defaults to '
' if null.getShadow()
- Parameters:
shadowRetina
- new retina shadow image- Returns:
- this icon
- See Also:
-
getShadowSize
Get the size of the shadow image in pixels.Used for auto centering the shadow image on '
' if set.getPoint()
- Returns:
- shadow image size
-
setShadowSize
Set the size of the shadow image in pixels.Used for auto centering the shadow image on '
' if set.getPoint()
- Parameters:
shadowSize
- new shadow image size- Returns:
- this icon
-
getShadowAnchor
Get the coordinates of the "tip" of the shadow image (relative to its top left corner).The icon will be aligned so that this point is at
getPoint()
.The same as
getAnchor()
if null.- Returns:
- icon anchor
-
setShadowAnchor
Set the coordinates of the "tip" of the shadow image (relative to its top left corner).The shadow image will be aligned so that this point is at
getPoint()
.The same as
getAnchor()
if null.- Parameters:
shadowAnchor
- new anchor- Returns:
- this icon
-
toJson
public com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializable
Jsonify this object.- Returns:
- object as json element
-
fromJson
-
equals
-
hashCode
public int hashCode() -
toString
-