Class Polyline
- All Implemented Interfaces:
JsonSerializable
This line could be used as a polygon's outer poly, or as inner poly to punch holes into the outer poly.
A minimum of 2 Point
s are needed to create a valid and
visible line for a polyline on the map.
A minimum of 3 Point
s are needed to create a valid and
visible line for a polygon on the map.
The last point you add does not need to be the same as the first point you added for a polygon.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Polyline
addPoint
(@NotNull Collection<@NotNull Point> points) Add points to this line.@NotNull Polyline
Add a point to this line.@NotNull Polyline
Add points to this line.@NotNull Polyline
Clear the list of points in this polyline.boolean
static @NotNull Polyline
fromJson
(@NotNull com.google.gson.JsonObject obj) Get the list of points in this polyline.int
hashCode()
@NotNull Polyline
loop()
Add the first point as the end point, closing off the shape.static @NotNull Polyline
of
(@NotNull String key, @NotNull Collection<@NotNull Point> points) Create a new line.static @NotNull Polyline
Create a new line.static @NotNull Polyline
Create a new line.@NotNull Polyline
removePoint
(@NotNull Collection<@NotNull Point> points) Remove points from this polyline.@NotNull Polyline
removePoint
(@NotNull Point point) Remove a point from this polyline.@NotNull Polyline
removePoint
(@NotNull Point @NotNull ... points) Remove points from this polyline.@NotNull com.google.gson.JsonObject
toJson()
Jsonify this object.@NotNull String
toString()
Methods inherited from class net.pl3x.map.core.markers.marker.Marker
circle, circle, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, getOptions, getPane, getType, icon, icon, icon, icon, icon, icon, icon, multiPolygon, multiPolygon, multiPolygon, multiPolyline, multiPolyline, multiPolyline, polygon, polygon, polygon, polyline, polyline, polyline, rectangle, rectangle, setOptions, setOptions, setPane
-
Constructor Details
-
Polyline
Create a new line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
key
- identifying keypoint
- point to add
-
Polyline
Create a new line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
key
- identifying keypoints
- points to add
-
Polyline
Create a new line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
key
- identifying keypoints
- points to add
-
-
Method Details
-
of
@NotNull public static @NotNull Polyline of(@NotNull @NotNull String key, @NotNull @NotNull Point point) Create a new line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
key
- identifying keypoint
- point to add- Returns:
- a new line
-
of
@NotNull public static @NotNull Polyline of(@NotNull @NotNull String key, @NotNull @NotNull Point @NotNull ... points) Create a new line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
key
- identifying keypoints
- points to add- Returns:
- a new line
-
of
@NotNull public static @NotNull Polyline of(@NotNull @NotNull String key, @NotNull @NotNull Collection<@NotNull Point> points) Create a new line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
key
- identifying keypoints
- points to add- Returns:
- a new line
-
getPoints
Get the list of points in this polyline.- Returns:
- list of points
-
clearPoints
Clear the list of points in this polyline.- Returns:
- this polyline
-
loop
Add the first point as the end point, closing off the shape.The last point you add does not need to be the same as the first point you added for a polygon.
- Returns:
- this line
-
addPoint
Add a point to this line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
point
- point to add- Returns:
- this line
-
addPoint
Add points to this line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
points
- points to add- Returns:
- this line
-
addPoint
Add points to this line.The last point you add does not need to be the same as the first point you added for a polygon.
- Parameters:
points
- points to add- Returns:
- this line
-
removePoint
Remove a point from this polyline.- Parameters:
point
- point to remove- Returns:
- this polyline
-
removePoint
Remove points from this polyline.- Parameters:
points
- points to remove- Returns:
- this polyline
-
removePoint
Remove points from this polyline.- Parameters:
points
- points to remove- Returns:
- this polyline
-
toJson
@NotNull public @NotNull com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializable
Jsonify this object.- Returns:
- object as json element
-
fromJson
-
equals
-
hashCode
public int hashCode() -
toString
-