public class GeoPolyline
extends java.lang.Object
GeoPolyline. A GeoPolyline consists of 2 or more points.
This class can be used with MapPolyline to
render a polyline.| Constructor and Description |
|---|
GeoPolyline()
Public Constructor
|
GeoPolyline(java.util.List<GeoCoordinate> points)
Creates a
GeoPolyline from a list of points. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(GeoCoordinate point)
Adds a new point into the
GeoPolyline. |
void |
add(java.util.List<GeoCoordinate> points)
Adds a list of new points into the
GeoPolyline. |
void |
clear()
Removes all points from the
GeoPolyline |
boolean |
contains(GeoCoordinate point)
Checks to see if a
GeoCoordinate resides within this GeoPolyline. |
boolean |
equals(java.lang.Object other) |
java.util.List<GeoCoordinate> |
getAllPoints()
Gets all points in the
GeoPolyline. |
GeoBoundingBox |
getBoundingBox()
Gets the geographic bounding box that contains this
GeoPolyline. |
GeoCoordinate |
getNearest(GeoCoordinate point)
Gets the
GeoCoordinate along the path of the MapPolyline that is closest to
the specified GeoCoordinate. |
int |
getNearestIndex(GeoCoordinate point)
Gets the index of the point that is closest to the specified
GeoCoordinate. |
int |
getNumberOfPoints()
Gets the total number of points currently in the
GeoPolyline. |
GeoCoordinate |
getPoint(int index)
Gets a point in the
GeoPolyline. |
int |
hashCode() |
void |
insert(GeoCoordinate point,
int index)
Inserts a point into the
GeoPolyline at index. |
double |
length()
The geographical length of this
GeoPolyline. |
void |
remove(int index)
Removes a specific point from the
GeoPolyline at the given index. |
public GeoPolyline()
public GeoPolyline(java.util.List<GeoCoordinate> points)
GeoPolyline from a list of points.points - A list of points to form the GeoPolylineMapPolylinepublic final int getNumberOfPoints()
GeoPolyline.public final GeoCoordinate getPoint(int index)
GeoPolyline.index - index of the point to get.GeoCoordinate. Returns null if the index is out of bound.public final java.util.List<GeoCoordinate> getAllPoints()
GeoPolyline.GeoCoordinate.public void add(java.util.List<GeoCoordinate> points)
GeoPolyline.points - A list of {code GeoCoordinate}s to be addedpublic void add(GeoCoordinate point)
GeoPolyline.point - Point to be addedpublic void insert(GeoCoordinate point, int index)
GeoPolyline at index.point - Point to be addedindex - Index to add the point into the list. index must be within the bounds of 0
and current count of points.public void remove(int index)
GeoPolyline at the given index.index - index of the point to be removed.public void clear()
GeoPolylinepublic double length()
GeoPolyline.public int getNearestIndex(GeoCoordinate point)
GeoCoordinate.point - A GeoCoordinate reference point for finding the nearest point's list indexGeoCoordinateGeoPolyline.getNearest(GeoCoordinate)public GeoCoordinate getNearest(GeoCoordinate point)
GeoCoordinate along the path of the MapPolyline that is closest to
the specified GeoCoordinate.point - A GeoCoordinate reference point for finding the nearest
GeoCoordinate along the MapPolyline pathGeoCoordinate along the MapPolyline path that is closest to the
specified GeoCoordinateGeoPolyline.getNearestIndex(GeoCoordinate)public boolean contains(GeoCoordinate point)
GeoCoordinate resides within this GeoPolyline.point - The coordinate that will be used to match against the points in this
GeoPolylineGeoPolylinepublic GeoBoundingBox getBoundingBox()
GeoPolyline.GeoBoundingBox that contains this GeoPolyline. Can be null if
the line has fewer than 2 points.public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object