Package net.pl3x.map.core.markers.layer
Class SimpleLayer
java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.markers.layer.Layer
net.pl3x.map.core.markers.layer.SimpleLayer
- All Implemented Interfaces:
JsonSerializable
- Direct Known Subclasses:
WorldLayer
Represents a simple layer of markers and other metadata.
-
Constructor Summary
ConstructorDescriptionSimpleLayer
(@NotNull String key, @NotNull Supplier<@NotNull String> labelSupplier) Create a new simple layer. -
Method Summary
Modifier and TypeMethodDescription@NotNull SimpleLayer
Add a new marker to this layer.@NotNull SimpleLayer
Remove all registered markers@NotNull Collection
<@NotNull Marker<?>> Get the markers to display in this Layer.boolean
Check whether a marker is registered for a key.Get an unmodifiable view of the registered markers.@Nullable Marker
<?> removeMarker
(@NotNull String key) Remove a marker from this layer, returning either the removed marker, ornull
if no marker was present for the provided key.Methods inherited from class net.pl3x.map.core.markers.layer.Layer
equals, getCss, getLabel, getPane, getPriority, getUpdateInterval, getUpdateInterval, getZIndex, hashCode, isDefaultHidden, isLiveUpdate, setCss, setDefaultHidden, setLabel, setLabel, setLiveUpdate, setPane, setPriority, setShowControls, setUpdateInterval, setUpdateInterval, setZIndex, shouldShowControls, toJson, toString
-
Constructor Details
-
Method Details
-
getMarkers
Description copied from class:Layer
Get the markers to display in this Layer.- Specified by:
getMarkers
in classLayer
- Returns:
- markers to display
-
addMarker
Add a new marker to this layer.- Parameters:
marker
- marker- Returns:
- this layer
-
removeMarker
Remove a marker from this layer, returning either the removed marker, ornull
if no marker was present for the provided key.- Parameters:
key
- key- Returns:
- the existing marker or
null
-
clearMarkers
Remove all registered markers -
registeredMarkers
Get an unmodifiable view of the registered markers.- Returns:
- registered markers
-
hasMarker
Check whether a marker is registered for a key.- Parameters:
key
- key- Returns:
- true if marker is registered
-