Class SimpleLayer

All Implemented Interfaces:
JsonSerializable
Direct Known Subclasses:
WorldLayer

public class SimpleLayer extends Layer
Represents a simple layer of markers and other metadata.
  • Constructor Details

    • SimpleLayer

      public SimpleLayer(@NotNull @NotNull String key, @NotNull @NotNull Supplier<@NotNull String> labelSupplier)
      Create a new simple layer.
      Parameters:
      key - key for layer
  • Method Details

    • getMarkers

      @NotNull public @NotNull Collection<@NotNull Marker<?>> getMarkers()
      Description copied from class: Layer
      Get the markers to display in this Layer.
      Specified by:
      getMarkers in class Layer
      Returns:
      markers to display
    • addMarker

      @NotNull public @NotNull SimpleLayer addMarker(@NotNull @NotNull Marker<?> marker)
      Add a new marker to this layer.
      Parameters:
      marker - marker
      Returns:
      this layer
    • removeMarker

      @Nullable public @Nullable Marker<?> removeMarker(@NotNull @NotNull String key)
      Remove a marker from this layer, returning either the removed marker, or null if no marker was present for the provided key.
      Parameters:
      key - key
      Returns:
      the existing marker or null
    • clearMarkers

      @NotNull public @NotNull SimpleLayer clearMarkers()
      Remove all registered markers
    • registeredMarkers

      @NotNull public @NotNull Map<@NotNull String,@NotNull Marker<?>> registeredMarkers()
      Get an unmodifiable view of the registered markers.
      Returns:
      registered markers
    • hasMarker

      public boolean hasMarker(@NotNull @NotNull String key)
      Check whether a marker is registered for a key.
      Parameters:
      key - key
      Returns:
      true if marker is registered