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)
Add a new point into the
GeoPolyline |
void |
add(java.util.List<GeoCoordinate> points)
Add a list of new points into the
GeoPolyline |
void |
clear()
Remove all points from the
GeoPolyline |
boolean |
contains(GeoCoordinate point)
Check to see if a
GeoCoordinate resides within this GeoPolyline |
boolean |
equals(java.lang.Object other) |
GeoBoundingBox |
getBoundingBox()
Get 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 in the path array that is closest to the specified
GeoCoordinate. |
int |
getNumberOfPoints()
Get the total number of points currently in the
GeoPolyline. |
GeoCoordinate |
getPoint(int index)
Get a point in the
GeoPolyline. |
int |
hashCode() |
void |
insert(GeoCoordinate point,
int index)
Insert a point into the
GeoPolyline at index |
double |
length()
The geographical length of this
GeoPolyline. |
void |
remove(int index)
Remove a specific point from the
GeoPolyline |
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 void add(java.util.List<GeoCoordinate> points)
GeoPolylinepoints - A list of {code GeoCoordinate}s to be addedpublic void add(GeoCoordinate point)
GeoPolylinepoint - Point to be addedpublic void insert(GeoCoordinate point, int index)
GeoPolyline at indexpoint - 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)
GeoPolylineindex - 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 index in the path
arrayGeoCoordinategetNearest(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 GeoCoordinategetNearestIndex(GeoCoordinate)public boolean contains(GeoCoordinate point)
GeoCoordinate resides within this GeoPolylinepoint - 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