Package net.pl3x.map.core.markers.marker
Class Marker<T extends Marker<T>>
java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.markers.marker.Marker<T>
- All Implemented Interfaces:
JsonSerializable
- Direct Known Subclasses:
Circle
,Ellipse
,Icon
,MultiPolygon
,MultiPolyline
,Polygon
,Polyline
,Rectangle
@NullMarked
public abstract class Marker<T extends Marker<T>>
extends Keyed
implements JsonSerializable
Represents a map marker.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Circle
Create a new circle.static Circle
Create a new circle.static Ellipse
Create a new ellipse.static Ellipse
Create a new ellipse.static Ellipse
Create a new ellipse.static Ellipse
Create a new ellipse.static Ellipse
Create a new ellipse.static Ellipse
Create a new ellipse.static Ellipse
Create a new ellipse.static Ellipse
Create a new ellipse.static Marker
<?> fromJson
(com.google.gson.JsonObject obj) @Nullable Options
Get the options of this marker.@Nullable String
getPane()
Get the map pane where the marker will be added.getType()
Get the type identifier of this marker.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static Icon
Create a new icon.static MultiPolygon
multiPolygon
(String key, List<Polygon> polygons) Create a new multi-polygon.static MultiPolygon
multiPolygon
(String key, Polygon polygon) Create a new multi-polygon.static MultiPolygon
multiPolygon
(String key, Polygon... polygons) Create a new multi-polygon.static MultiPolyline
multiPolyline
(String key, List<Polyline> polylines) Create a new multi-polyline.static MultiPolyline
multiPolyline
(String key, Polyline polyline) Create a new multi-polyline.static MultiPolyline
multiPolyline
(String key, Polyline... polylines) Create a new multi-polyline.static Polygon
Create a new polygon.static Polygon
Create a new polygon.static Polygon
Create a new polygon.static Polyline
Create a new polyline.static Polyline
Create a new polyline.static Polyline
Create a new polyline.static Rectangle
Create a new rectangle.static Rectangle
Create a new rectangle.setOptions
(@Nullable Options options) Set new options for this marker.setOptions
(@Nullable Options.Builder builder) Set new options for this marker.Set the map pane where the marker will be added.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.pl3x.map.core.markers.JsonSerializable
toJson
-
Constructor Details
-
Marker
Create a new marker.- Parameters:
type
- type of markerkey
- identifying key
-
-
Method Details
-
circle
Create a new circle.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradius
- circle radius- Returns:
- a new circle
-
circle
Create a new circle.- Parameters:
key
- identifying keycenter
- center locationradius
- circle radius- Returns:
- a new circle
-
ellipse
public static Ellipse ellipse(String key, double centerX, double centerZ, double radiusX, double radiusZ) Create a new ellipse.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradiusX
- x radiusradiusZ
- z radius- Returns:
- a new ellipse
-
ellipse
Create a new ellipse.- Parameters:
key
- identifying keycenter
- center locationradiusX
- x radiusradiusZ
- z radius- Returns:
- a new ellipse
-
ellipse
Create a new ellipse.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradius
- radius- Returns:
- a new ellipse
-
ellipse
Create a new ellipse.- Parameters:
key
- identifying keycenter
- center locationradius
- radius- Returns:
- a new ellipse
-
ellipse
public static Ellipse ellipse(String key, double centerX, double centerZ, double radiusX, double radiusZ, double tilt) Create a new ellipse.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradiusX
- x radiusradiusZ
- z radiustilt
- tilt- Returns:
- a new ellipse
-
ellipse
public static Ellipse ellipse(String key, Point center, double radiusX, double radiusZ, double tilt) Create a new ellipse.- Parameters:
key
- identifying keycenter
- center locationradiusX
- x radiusradiusZ
- z radiustilt
- tilt- Returns:
- a new ellipse
-
ellipse
public static Ellipse ellipse(String key, double centerX, double centerZ, Vector radius, double tilt) Create a new ellipse.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradius
- radiustilt
- tilt- Returns:
- a new ellipse
-
ellipse
Create a new ellipse.- Parameters:
key
- identifying keycenter
- center locationradius
- radiustilt
- tilt- Returns:
- a new ellipse
-
icon
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image key- Returns:
- a new icon
-
icon
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image key- Returns:
- a new icon
-
icon
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image keysize
- size of image- Returns:
- a new icon
-
icon
Create a new icon.- Parameters:
key
- identifying keyx
- icon x location on mapz
- icon z location on mapimage
- image keywidth
- width of imageheight
- height of image- Returns:
- a new icon
-
icon
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keysize
- size of image- Returns:
- a new icon
-
icon
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keywidth
- width of imageheight
- height of image- Returns:
- a new icon
-
icon
Create a new icon.- Parameters:
key
- identifying keypoint
- icon location on mapimage
- image keysize
- size of image- Returns:
- a new icon
-
multiPolygon
Create a new multi-polygon.- Parameters:
key
- identifying keypolygon
- polygon to add- Returns:
- a new multi-polygon
-
multiPolygon
Create a new multi-polygon.- Parameters:
key
- identifying keypolygons
- polygons to add- Returns:
- a new multi-polygon
-
multiPolygon
Create a new multi-polygon.- Parameters:
key
- identifying keypolygons
- polygons to add- Returns:
- a new multi-polygon
-
multiPolyline
Create a new multi-polyline.- Parameters:
key
- identifying keypolyline
- polyline to add- Returns:
- a new multi-polyline
-
multiPolyline
Create a new multi-polyline.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new multi-polyline
-
multiPolyline
Create a new multi-polyline.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new multi-polyline
-
polygon
Create a new polygon.- Parameters:
key
- identifying keypolyline
- polyline to add- Returns:
- a new polygon
-
polygon
Create a new polygon.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new polygon
-
polygon
Create a new polygon.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new polygon
-
polyline
Create a new polyline.- Parameters:
key
- identifying keypoint
- point to add- Returns:
- a new polyline
-
polyline
Create a new polyline.- Parameters:
key
- identifying keypoints
- points to add- Returns:
- a new polyline
-
polyline
Create a new polyline.- Parameters:
key
- identifying keypoints
- points to add- Returns:
- a new polyline
-
rectangle
Create a new rectangle.- Parameters:
key
- identifying keyx1
- first x pointz1
- first z pointx2
- second x pointz2
- second z point- Returns:
- a new rectangle
-
rectangle
Create a new rectangle.- Parameters:
key
- identifying keypoint1
- first pointpoint2
- second point- Returns:
- a new rectangle
-
getType
Get the type identifier of this marker.Used in the serialized json for the frontend.
- Returns:
- marker type
-
getPane
Get the map pane where the marker will be added.Defaults to the overlay pane if null.
- Returns:
- map pane
-
setPane
Set the map pane where the marker will be added.If the pane does not exist, it will be created the first time it is used.
Defaults to the overlay pane if null.
- Parameters:
pane
- map pane- Returns:
- this marker
-
getOptions
Get the options of this marker.Null options represents "default" values. See wiki about defaults.
- Returns:
- marker options
-
setOptions
Set new options for this marker.Null options represents "default" values. See wiki about defaults.
- Parameters:
options
- new options or null- Returns:
- this marker
-
setOptions
Set new options for this marker.Null options represents "default" values. See wiki about defaults.
- Parameters:
builder
- new options builder or null- Returns:
- this marker
-
fromJson
-