Class Popup
- All Implemented Interfaces:
JsonSerializable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @NotNull PopupfromJson(@NotNull com.google.gson.JsonObject obj) @Nullable PointGet the margin between the popup and the map view after auto panning was performed.@Nullable PointGet the margin between the popup and the bottom right corner of the map view after auto panning was performed.@Nullable PointGet the margin between the popup and the top left corner of the map view after auto panning was performed.@Nullable StringGet the content of this popup rule.@Nullable IntegerGet the max height of the popup.@Nullable IntegerGet the max width of the popup.@Nullable IntegerGet the min width of the popup.@Nullable PointGet offset of this popup rule.@Nullable StringgetPane()Get the map pane where the popup will be added.@Nullable BooleanGet whether the popup has a close button.inthashCode()booleanCheck whether all options are defaults (all are null)@NotNull PopupsetAutoPanPadding(@Nullable Point autoPanPadding) Set the margin between the popup and the map view after auto panning was performed.@NotNull PopupsetAutoPanPaddingBottomRight(@Nullable Point autoPanPaddingBottomRight) Set the margin between the popup and the bottom right corner of the map view after auto panning was performed.@NotNull PopupsetAutoPanPaddingTopLeft(@Nullable Point autoPanPaddingTopLeft) Set the margin between the popup and the top left corner of the map view after auto panning was performed.@NotNull PopupsetCloseButton(@Nullable Boolean closeButton) Set whether the popup has a close button.@NotNull PopupsetContent(@Nullable String content) Set the content for this popup rule.@NotNull PopupsetMaxHeight(@Nullable Integer maxHeight) Set the max height of the popup.@NotNull PopupsetMaxWidth(@Nullable Integer maxWidth) Set the max width of the popup.@NotNull PopupsetMinWidth(@Nullable Integer minWidth) Set the min width of the popup.@NotNull PopupSet offset of this popup rule from marker point@NotNull PopupSet the map pane where the popup will be added.@NotNull PopupsetShouldAutoClose(@Nullable Boolean autoClose) Set whether the popup automatically closes when another popup is opened.@NotNull PopupsetShouldAutoPan(@Nullable Boolean autoPan) Set whether the map should automatically pan to fit the opened popup.@NotNull PopupsetShouldCloseOnClick(@Nullable Boolean closeOnClick) Set whether the popup closes when the map is clicked.@NotNull PopupsetShouldCloseOnEscapeKey(@Nullable Boolean closeOnEscapeKey) Set whether the popup closes with the escape key.@NotNull PopupsetShouldKeepInView(@Nullable Boolean keepInView) Set whether the popup should stay in view.@Nullable BooleanGet whether the popup automatically closes when another popup is opened.@Nullable BooleanGet whether the map should automatically pan to fit the opened popup.@Nullable BooleanGet whether the popup closes when the map is clicked.@Nullable BooleanGet whether the popup closes with the escape key.@Nullable BooleanGet whether the popup should stay in view.@NotNull com.google.gson.JsonObjecttoJson()Jsonify this object.@NotNull StringtoString()
-
Field Details
-
DEFAULT_OFFSET
-
DEFAULT_AUTO_PAN_PADDING
-
-
Constructor Details
-
Popup
public Popup()Create a popup rule with default options. -
Popup
Create a popup rule.- Parameters:
content- popup content
-
-
Method Details
-
getContent
Get the content of this popup rule.If null, the popup rule is effectively disabled.
- Returns:
- popup content
-
setContent
Set the content for this popup rule.HTML is valid here.
If null, the popup rule is effectively disabled.
- Parameters:
content- popup content- Returns:
- this popup rule
-
getPane
Get the map pane where the popup will be added.Defaults to '
popupPane' if null.- Returns:
- map pane
-
setPane
Set the map pane where the popup will be added.If the pane does not exist, it will be created the first time it is used.
Defaults to '
popupPane' if null.- Parameters:
pane- map pane- Returns:
- this popup rule
-
getOffset
Get offset of this popup rule.Defaults to '
new' if null.Point(0, 7)- Returns:
- popup offset from marker point
-
setOffset
Set offset of this popup rule from marker pointDefaults to '
new' if null.Point(0, 7)- Parameters:
offset- popup offset- Returns:
- this popup rule
-
getMaxWidth
Get the max width of the popup.Defaults to '
300' if null.- Returns:
- max width
-
setMaxWidth
Set the max width of the popup.Defaults to '
300' if null.- Parameters:
maxWidth- max width- Returns:
- this popup rule
-
getMinWidth
Get the min width of the popup.Defaults to '
50' if null.- Returns:
- min width
-
setMinWidth
Set the min width of the popup.Defaults to '
50' if null.- Parameters:
minWidth- min width- Returns:
- this popup rule
-
getMaxHeight
Get the max height of the popup.If set, creates a scrollable container of the given height inside a popup if its content exceeds it.
- Returns:
- max height
-
setMaxHeight
Set the max height of the popup.If set, creates a scrollable container of the given height inside a popup if its content exceeds it.
- Parameters:
maxHeight- max height- Returns:
- this popup rule
-
shouldAutoPan
Get whether the map should automatically pan to fit the opened popup.Defaults to '
true' if null.- Returns:
- true to auto pan
-
setShouldAutoPan
Set whether the map should automatically pan to fit the opened popup.Defaults to '
true' if null.- Parameters:
autoPan- true to auto pan- Returns:
- this popup rule
-
getAutoPanPaddingTopLeft
Get the margin between the popup and the top left corner of the map view after auto panning was performed.If set, overrides the top left values of
getAutoPanPadding().- Returns:
- top left corner padding margins
-
setAutoPanPaddingTopLeft
@NotNull public @NotNull Popup setAutoPanPaddingTopLeft(@Nullable @Nullable Point autoPanPaddingTopLeft) Set the margin between the popup and the top left corner of the map view after auto panning was performed.If set, overrides the top left values of
getAutoPanPadding().- Parameters:
autoPanPaddingTopLeft- top left corner padding margins- Returns:
- this popup rule
-
getAutoPanPaddingBottomRight
Get the margin between the popup and the bottom right corner of the map view after auto panning was performed.If set, overrides the bottom right values of
getAutoPanPadding().- Returns:
- bottom right corner padding margins
-
setAutoPanPaddingBottomRight
@NotNull public @NotNull Popup setAutoPanPaddingBottomRight(@Nullable @Nullable Point autoPanPaddingBottomRight) Set the margin between the popup and the bottom right corner of the map view after auto panning was performed.If set, overrides the bottom right values of
getAutoPanPadding().- Parameters:
autoPanPaddingBottomRight- bottom right corner padding margins- Returns:
- this popup rule
-
getAutoPanPadding
Get the margin between the popup and the map view after auto panning was performed.This is the equivalent of the same values in both
getAutoPanPaddingTopLeft()andgetAutoPanPaddingBottomRight()Defaults to '
new' if null.Point(5, 5)- Returns:
- padding margins
-
setAutoPanPadding
Set the margin between the popup and the map view after auto panning was performed.This is the equivalent of the same values in both
getAutoPanPaddingTopLeft()andgetAutoPanPaddingBottomRight()Defaults to '
new' if null.Point(5, 5)- Parameters:
autoPanPadding- padding margins- Returns:
- this popup rule
-
shouldKeepInView
Get whether the popup should stay in view.If set to true it will prevent users from panning the popup off of the screen while it is open.
Defaults to '
false' if null.- Returns:
- true to keep popup in view
-
setShouldKeepInView
Set whether the popup should stay in view.If set to true it will prevent users from panning the popup off of the screen while it is open.
Defaults to '
false' if null.- Parameters:
keepInView- true to keep popup in view- Returns:
- this popup rule
-
hasCloseButton
Get whether the popup has a close button.Defaults to '
true' if null.- Returns:
- true if popup has close button
-
setCloseButton
Set whether the popup has a close button.Defaults to '
true' if null.- Parameters:
closeButton- true if popup has close button- Returns:
- this popup rule
-
shouldAutoClose
Get whether the popup automatically closes when another popup is opened.Defaults to '
true' if null.- Returns:
- true if popup auto closes
-
setShouldAutoClose
Set whether the popup automatically closes when another popup is opened.Defaults to '
true' if null.- Parameters:
autoClose- true if popup auto closes- Returns:
- this popup rule
-
shouldCloseOnEscapeKey
Get whether the popup closes with the escape key.Defaults to '
true' if null.- Returns:
- true to close with escape
-
setShouldCloseOnEscapeKey
@NotNull public @NotNull Popup setShouldCloseOnEscapeKey(@Nullable @Nullable Boolean closeOnEscapeKey) Set whether the popup closes with the escape key.Defaults to '
true' if null.- Parameters:
closeOnEscapeKey- true to close with escape- Returns:
- this popup rule
-
shouldCloseOnClick
Get whether the popup closes when the map is clicked.Defaults to '
true' if null.- Returns:
- true to close on map click
-
setShouldCloseOnClick
Set whether the popup closes when the map is clicked.Defaults to '
true' if null.- Parameters:
closeOnClick- true to close on map click- Returns:
- this popup rule
-
isDefault
public boolean isDefault()Description copied from class:OptionCheck whether all options are defaults (all are null) -
toJson
@NotNull public @NotNull com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializableJsonify this object.- Returns:
- object as json element
-
fromJson
-
equals
-
hashCode
public int hashCode() -
toString
-