Class Marker

java.lang.Object
xyz.jpenilla.squaremap.api.marker.Marker
Direct Known Subclasses:
Circle, Ellipse, Icon, MultiPolygon, Polygon, Polyline, Rectangle

public abstract class Marker extends Object
Parent class to all map markers, also contains static factory methods for different marker types
  • Constructor Details

    • Marker

      protected Marker()
  • Method Details

    • markerOptions

      public final @NonNull MarkerOptions markerOptions()
      Get the current marker options used by this marker
      Returns:
      options
    • markerOptions

      public final @NonNull Marker markerOptions(@NonNull MarkerOptions markerOptions)
      Set the marker options for this marker
      Parameters:
      markerOptions - new options
      Returns:
      this marker
    • markerOptions

      public final @NonNull Marker markerOptions(@NonNull MarkerOptions.Builder markerOptionsBuilder)
      Set the marker options for this marker
      Parameters:
      markerOptionsBuilder - new options
      Returns:
      this marker
    • polyline

      public static @NonNull Polyline polyline(@NonNull List<Point> points)
      Create a new polyline from a list of points
      Parameters:
      points - points
      Returns:
      new polyline
    • polyline

      public static @NonNull Polyline polyline(@NonNull Point @NonNull ... points)
      Create a new polyline from a list of points
      Parameters:
      points - points
      Returns:
      new polyline
    • multiPolyline

      public static @NonNull Polyline multiPolyline(@NonNull List<List<Point>> points)
      Create a new multi-polyline from a list of lists of points
      Parameters:
      points - points
      Returns:
      new polyline
    • multiPolyline

      @SafeVarargs public static @NonNull Polyline multiPolyline(@NonNull List<Point> @NonNull ... points)
      Create a new multi-polyline from a list of lists of points
      Parameters:
      points - points
      Returns:
      new polyline
    • rectangle

      public static @NonNull Rectangle rectangle(@NonNull Point point1, @NonNull Point point2)
      Create a new rectangle marker from two corner points
      Parameters:
      point1 - first corner
      point2 - second corner
      Returns:
      new rectangle
    • circle

      public static @NonNull Circle circle(@NonNull Point center, double radius)
      Create a new circle marker
      Parameters:
      center - center point
      radius - radius
      Returns:
      new circle
    • ellipse

      public static @NonNull Ellipse ellipse(@NonNull Point center, double radiusX, double radiusZ)
      Create a new ellipse marker
      Parameters:
      center - center point
      radiusX - radiusX
      radiusZ - radiusZ
      Returns:
      new ellipse
    • icon

      public static @NonNull Icon icon(@NonNull Point point, @NonNull Point tooltipAnchor, @NonNull Point anchor, @NonNull Key image, int sizeX, int sizeZ)
      Create a new icon marker
      Parameters:
      point - location for this marker
      tooltipAnchor - tooltip anchor, see Icon.tooltipAnchor()
      anchor - icon anchor, see Icon.anchor()
      image - image key, must be registered with the icon registry.
      sizeX - x size
      sizeZ - z size
      Returns:
      new icon
    • icon

      public static @NonNull Icon icon(@NonNull Point point, @NonNull Key image, int sizeX, int sizeZ)
      Create a new icon marker
      Parameters:
      point - location for this marker
      image - image key, must be registered with the icon registry.
      sizeX - x size
      sizeZ - z size
      Returns:
      new icon
    • icon

      public static @NonNull Icon icon(@NonNull Point point, @NonNull Key image, int size)
      Create a new icon marker
      Parameters:
      point - location for this marker
      image - image key, must be registered with the icon registry.
      size - size to use for X and Z size
      Returns:
      new icon
    • multiPolygon

      public static @NonNull MultiPolygon multiPolygon(@NonNull MultiPolygon.MultiPolygonPart @NonNull ... polygons)
      Create a new multi polygon marker from parts
      Parameters:
      polygons - parts
      Returns:
      new multi polygon
    • multiPolygon

      public static @NonNull MultiPolygon multiPolygon(@NonNull List<MultiPolygon.MultiPolygonPart> polygons)
      Create a new multi polygon marker from parts
      Parameters:
      polygons - parts
      Returns:
      new multi polygon
    • polygon

      public static @NonNull Polygon polygon(@NonNull Point @NonNull ... points)
      Create a new polygon marker from points
      Parameters:
      points - points
      Returns:
      new polygon
    • polygon

      public static @NonNull Polygon polygon(@NonNull List<Point> points)
      Create a new polygon marker from points
      Parameters:
      points - points
      Returns:
      new polygon
    • polygon

      public static @NonNull Polygon polygon(@NonNull List<Point> mainPolygon, @NonNull List<List<Point>> negativeSpace)
      Create a new polygon marker from a main polygon, and a list of polygons which make up the negative space
      Parameters:
      mainPolygon - main polygon
      negativeSpace - negative space polygons
      Returns:
      new polygon
    • polygon

      @SafeVarargs public static @NonNull Polygon polygon(@NonNull List<Point> mainPolygon, @NonNull List<Point> @NonNull ... negativeSpace)
      Create a new polygon marker from a main polygon, and a list of polygons which make up the negative space
      Parameters:
      mainPolygon - main polygon
      negativeSpace - negative space polygons
      Returns:
      new polygon
    • markerOptionsMatch

      protected boolean markerOptionsMatch(Marker marker)