Package net.pl3x.map.core.markers.layer
Class Layer
java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.markers.layer.Layer
- All Implemented Interfaces:
JsonSerializable
- Direct Known Subclasses:
SimpleLayer
Represents a layer of markers and other metadata.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable StringgetCss()Get the custom CSS to add for this layer.@NotNull StringgetLabel()Get the label of this layer, shown in the control box.abstract @NotNull Collection<@NotNull Marker<?>>Get the markers to display in this Layer.@Nullable StringgetPane()Get the map pane for this layer.intGet the indexed order for this layer in the control box.intGet this layer's update interval (in seconds).@Nullable IntegerGet the z-index for this layer.inthashCode()booleanGet if this layer is hidden by default in the control box.@NotNull LayerSet the custom CSS to add for this layer.@NotNull LayersetDefaultHidden(boolean defaultHidden) Set if this layer is hidden by default in the control box.@NotNull LayerSet the label of this layer, shown in the control box.@NotNull LayerSet the label supplier of this layer, shown in the control box.@NotNull LayerSet the map pane for this layer.@NotNull LayersetPriority(int priority) Set the indexed order for this layer in the control box.@NotNull LayersetShowControls(boolean showControls) Set whether to show this layer in the control box.@NotNull LayersetUpdateInterval(int updateInterval) Set this layer's update interval (in seconds).@NotNull LayerSet the z-index for this layer.booleanGet whether to show this layer in the control box.@NotNull com.google.gson.JsonObjecttoJson()Jsonify this object.@NotNull StringtoString()
-
Constructor Details
-
Method Details
-
getLabel
Get the label of this layer, shown in the control box.- Returns:
- layer label
-
setLabel
Set the label of this layer, shown in the control box.- Parameters:
label- new label- Returns:
- this layer
-
setLabel
Set the label supplier of this layer, shown in the control box.- Parameters:
labelSupplier- new label supplier- Returns:
- this layer
-
getUpdateInterval
public int getUpdateInterval()Get this layer's update interval (in seconds).- Returns:
- update interval
-
setUpdateInterval
Set this layer's update interval (in seconds).- Parameters:
updateInterval- new update interval- Returns:
- this layer
-
shouldShowControls
public boolean shouldShowControls()Get whether to show this layer in the control box.- Returns:
- true if showing controls
-
setShowControls
Set whether to show this layer in the control box.- Parameters:
showControls- true to show- Returns:
- this layer
-
isDefaultHidden
public boolean isDefaultHidden()Get if this layer is hidden by default in the control box.- Returns:
- true if hidden by default
-
setDefaultHidden
Set if this layer is hidden by default in the control box.- Parameters:
defaultHidden- true to hide by default- Returns:
- this layer
-
getPriority
public int getPriority()Get the indexed order for this layer in the control box.Falls back to alphanumeric ordering based on label if there are order conflicts.
- Returns:
- layer priority
-
setPriority
Set the indexed order for this layer in the control box.Falls back to alphanumeric ordering based on label if there are order conflicts.
- Parameters:
priority- new priority- Returns:
- this layer
-
getZIndex
Get the z-index for this layer. Used in determining what layers are visually on top of other layers.Falls back to alphanumeric ordering based on name if there are order conflicts.
Defaults to '
' if null.getPriority()- Returns:
- layer z-index
-
setZIndex
Set the z-index for this layer. Used in determining what layers are visually on top of other layers.Falls back to alphanumeric ordering based on name if there are order conflicts.
Defaults to '
' if null.getPriority()- Parameters:
zIndex- new z-index- Returns:
- this layer
-
getPane
Get the map pane for this layer.- Returns:
- map pane
-
setPane
Set the map pane for this layer.If the pane does not exist, it will be created the first time it is used.
- Parameters:
pane- new map pane- Returns:
- this layer
-
getCss
Get the custom CSS to add for this layer.- Returns:
- custom CSS
-
setCss
Set the custom CSS to add for this layer.- Parameters:
css- new custom CSS- Returns:
- this layer
-
getMarkers
Get the markers to display in this Layer.- Returns:
- markers to display
-
toJson
@NotNull public @NotNull com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializableJsonify this object.- Specified by:
toJsonin interfaceJsonSerializable- Returns:
- object as json element
-
equals
-
hashCode
public int hashCode() -
toString
-