Class Marker
java.lang.Object
xyz.jpenilla.squaremap.api.marker.Marker
Parent class to all map markers, also contains static factory methods for different marker types
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a new circle markerCreate a new ellipse markerCreate a new icon markerCreate a new icon markericon(@NonNull Point point, @NonNull Point tooltipAnchor, @NonNull Point anchor, @NonNull Key image, int sizeX, int sizeZ) Create a new icon markerfinal @NonNull MarkerOptionsGet the current marker options used by this markermarkerOptions(@NonNull MarkerOptions markerOptions) Set the marker options for this markermarkerOptions(@NonNull MarkerOptions.Builder markerOptionsBuilder) Set the marker options for this markerprotected booleanmarkerOptionsMatch(Marker marker) static @NonNull MultiPolygonmultiPolygon(@NonNull List<MultiPolygon.MultiPolygonPart> polygons) Create a new multi polygon marker from partsstatic @NonNull MultiPolygonmultiPolygon(@NonNull MultiPolygon.MultiPolygonPart @NonNull ... polygons) Create a new multi polygon marker from partsmultiPolyline(@NonNull List<List<Point>> points) Create a new multi-polyline from a list of lists of pointsmultiPolyline(@NonNull List<Point> @NonNull ... points) Create a new multi-polyline from a list of lists of pointsCreate a new polygon marker from pointsCreate a new polygon marker from a main polygon, and a list of polygons which make up the negative spaceCreate a new polygon marker from a main polygon, and a list of polygons which make up the negative spaceCreate a new polygon marker from pointsCreate a new polyline from a list of pointsCreate a new polyline from a list of pointsCreate a new rectangle marker from two corner points
-
Constructor Details
-
Marker
protected Marker()
-
-
Method Details
-
markerOptions
Get the current marker options used by this marker- Returns:
- options
-
markerOptions
Set the marker options for this marker- Parameters:
markerOptions- new options- Returns:
- this marker
-
markerOptions
Set the marker options for this marker- Parameters:
markerOptionsBuilder- new options- Returns:
- this marker
-
polyline
Create a new polyline from a list of points- Parameters:
points- points- Returns:
- new polyline
-
polyline
Create a new polyline from a list of points- Parameters:
points- points- Returns:
- new polyline
-
multiPolyline
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
Create a new rectangle marker from two corner points- Parameters:
point1- first cornerpoint2- second corner- Returns:
- new rectangle
-
circle
Create a new circle marker- Parameters:
center- center pointradius- radius- Returns:
- new circle
-
ellipse
Create a new ellipse marker- Parameters:
center- center pointradiusX- radiusXradiusZ- 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 markertooltipAnchor- tooltip anchor, seeIcon.tooltipAnchor()anchor- icon anchor, seeIcon.anchor()image- image key, must be registered with theicon registry.sizeX- x sizesizeZ- z size- Returns:
- new icon
-
icon
Create a new icon marker- Parameters:
point- location for this markerimage- image key, must be registered with theicon registry.sizeX- x sizesizeZ- z size- Returns:
- new icon
-
icon
Create a new icon marker- Parameters:
point- location for this markerimage- image key, must be registered with theicon 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
Create a new polygon marker from points- Parameters:
points- points- Returns:
- new polygon
-
polygon
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 polygonnegativeSpace- 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 polygonnegativeSpace- negative space polygons- Returns:
- new polygon
-
markerOptionsMatch
-