Class Popup
- All Implemented Interfaces:
JsonSerializable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
static Popup
fromJson
(com.google.gson.JsonObject obj) @Nullable Point
Get the margin between the popup and the map view after auto panning was performed.@Nullable Point
Get the margin between the popup and the bottom right corner of the map view after auto panning was performed.@Nullable Point
Get the margin between the popup and the top left corner of the map view after auto panning was performed.@Nullable String
Get the content of this popup rule.@Nullable Integer
Get the max height of the popup.@Nullable Integer
Get the max width of the popup.@Nullable Integer
Get the min width of the popup.@Nullable Point
Get offset of this popup rule.@Nullable String
getPane()
Get the map pane where the popup will be added.@Nullable Boolean
Get whether the popup has a close button.int
hashCode()
boolean
Check whether all options are defaults (all are null)setAutoPanPadding
(@Nullable Point autoPanPadding) Set the margin between the popup and the map view after auto panning was performed.setAutoPanPaddingBottomRight
(@Nullable Point autoPanPaddingBottomRight) Set the margin between the popup and the bottom right corner of the map view after auto panning was performed.setAutoPanPaddingTopLeft
(@Nullable Point autoPanPaddingTopLeft) Set the margin between the popup and the top left corner of the map view after auto panning was performed.setCloseButton
(@Nullable Boolean closeButton) Set whether the popup has a close button.setContent
(@Nullable String content) Set the content for this popup rule.setMaxHeight
(@Nullable Integer maxHeight) Set the max height of the popup.setMaxWidth
(@Nullable Integer maxWidth) Set the max width of the popup.setMinWidth
(@Nullable Integer minWidth) Set the min width of the popup.Set offset of this popup rule from marker pointSet the map pane where the popup will be added.setShouldAutoClose
(@Nullable Boolean autoClose) Set whether the popup automatically closes when another popup is opened.setShouldAutoPan
(@Nullable Boolean autoPan) Set whether the map should automatically pan to fit the opened popup.setShouldCloseOnClick
(@Nullable Boolean closeOnClick) Set whether the popup closes when the map is clicked.setShouldCloseOnEscapeKey
(@Nullable Boolean closeOnEscapeKey) Set whether the popup closes with the escape key.setShouldKeepInView
(@Nullable Boolean keepInView) Set whether the popup should stay in view.@Nullable Boolean
Get whether the popup automatically closes when another popup is opened.@Nullable Boolean
Get whether the map should automatically pan to fit the opened popup.@Nullable Boolean
Get whether the popup closes when the map is clicked.@Nullable Boolean
Get whether the popup closes with the escape key.@Nullable Boolean
Get whether the popup should stay in view.com.google.gson.JsonObject
toJson()
Jsonify this object.toString()
-
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
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
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
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: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
-