Class Tooltip
- All Implemented Interfaces:
JsonSerializable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Represents the direction where to open the tooltip. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Tooltip
fromJson
(com.google.gson.JsonObject obj) @Nullable String
Get the content of this tooltip rule.@Nullable Tooltip.Direction
Get the direction where to open the tooltip.@Nullable Point
Get offset of this tooltip rule.@Nullable Double
Get the tooltip opacity percent.@Nullable String
getPane()
Get the map pane where the tooltip will be added.int
hashCode()
boolean
Check whether all options are defaults (all are null)@Nullable Boolean
Get whether to open the tooltip permanently or only on mouseover.@Nullable Boolean
isSticky()
Get whether the tooltip is sticky or not.setContent
(@Nullable String content) Set the content for this tooltip rule.setDirection
(@Nullable Tooltip.Direction direction) Set the direction where to open the tooltip.Set offset of this tooltip rule from marker point.setOpacity
(@Nullable Double opacity) Set the tooltip opacity percent.Set the map pane where the tooltip will be added.setPermanent
(@Nullable Boolean permanent) Set whether to open the tooltip permanently or only on mouseoverSet whether the tooltip is sticky or not.com.google.gson.JsonObject
toJson()
Jsonify this object.toString()
-
Field Details
-
DEFAULT_OFFSET
-
-
Constructor Details
-
Tooltip
public Tooltip()Create a tooltip rule with default options. -
Tooltip
Create a tooltip rule.- Parameters:
string
- tooltip content
-
-
Method Details
-
getContent
Get the content of this tooltip rule.If null, the tooltip rule is effectively disabled.
- Returns:
- tooltip content
-
setContent
Set the content for this tooltip rule.HTML is valid here.
If null, the tooltip rule is effectively disabled.
- Parameters:
content
- tooltip content- Returns:
- this tooltip rule
-
getPane
Get the map pane where the tooltip will be added.Defaults to '
tooltipPane
' if null.- Returns:
- map pane
-
setPane
Set the map pane where the tooltip will be added.If the pane does not exist, it will be created the first time it is used.
Defaults to '
tooltipPane
' if null.- Parameters:
pane
- map pane- Returns:
- this tooltip rule
-
getOffset
Get offset of this tooltip rule.Defaults to '
' if null.Point.ZERO
- Returns:
- tooltip offset from marker point
-
setOffset
Set offset of this tooltip rule from marker point.Defaults to '
' if null.Point.ZERO
- Parameters:
offset
- tooltip offset- Returns:
- this tooltip rule
-
getDirection
Get the direction where to open the tooltip.Defaults to '
' if null.Tooltip.Direction.AUTO
- Returns:
- opening direction
-
setDirection
Set the direction where to open the tooltip.Defaults to '
' if null.Tooltip.Direction.AUTO
- Parameters:
direction
- opening direction- Returns:
- this tooltip rule
-
isPermanent
Get whether to open the tooltip permanently or only on mouseover.Defaults to '
false
' if null.- Returns:
- true if opened permanently
-
setPermanent
Set whether to open the tooltip permanently or only on mouseoverDefaults to '
false
' if null.- Parameters:
permanent
- opened permanently- Returns:
- this tooltip rule
-
isSticky
Get whether the tooltip is sticky or not.A sticky tooltip will stick to and follow the mouse instead of the anchor.
Defaults to '
false
' if null.- Returns:
- sticky state
-
setSticky
Set whether the tooltip is sticky or not.A sticky tooltip will stick to and follow the mouse instead of the anchor.
Defaults to '
false
' if null.- Parameters:
sticky
- sticky state- Returns:
- this tooltip rule
-
getOpacity
Get the tooltip opacity percent.Defaults to '
0.9D
' if null.- Returns:
- tooltip opacity
-
setOpacity
Set the tooltip opacity percent.Defaults to '
0.9D
' if null.- Parameters:
opacity
- tooltip opacity- Returns:
- this tooltip rule
-
isDefault
public boolean isDefault()Description copied from class:Option
Check whether all options are defaults (all are null) -
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
-