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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPoint
(Collection<Point> points) Add points to this line.Add a point to this line.Add points to this line.Clear the list of points in this polyline.boolean
static Polyline
fromJson
(com.google.gson.JsonObject obj) Get the list of points in this polyline.int
hashCode()
loop()
Add the first point as the end point, closing off the shape.static Polyline
of
(String key, Collection<Point> points) Create a new line.static Polyline
Create a new line.static Polyline
Create a new line.removePoint
(Collection<Point> points) Remove points from this polyline.removePoint
(Point point) Remove a point from this polyline.removePoint
(Point... points) Remove points from this polyline.com.google.gson.JsonObject
toJson()
Jsonify this object.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
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
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
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
public 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
-