java.lang.Object | |||
↳ | com.neomades.maps.overlay.BaseOverlay | ||
↳ | com.neomades.maps.overlay.Overlay | ||
↳ | com.neomades.maps.overlay.Polyline |
A polyline is a list of points, where line segments are drawn between consecutive points. A polyline has the following properties:
The vertices of the line. Line segments are drawn between consecutive points. A polyline is not closed by default; to form a closed polyline, the start and end points must be the same.
Line segment width in screen pixels. The width is constant and independent of the camera's zoom level. The default value is 10.
Line segment color in ARGB format, the same format used by Color. The default value is black (0xff000000).
The order in which this tile overlay is drawn with respect to other overlays (including Circles and Polygons but not Markers). An overlay with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays with the same z-index is arbitrary. The default z-index is 0.
Indicates if the polyline is visible or invisible, i.e., whether it is drawn on the map. An invisible polyline is not drawn, but retains all of its other properties. The default is true, i.e., visible.
Indicates whether the segments of the polyline should be drawn as geodesics, as opposed to straight lines on the Mercator projection. A geodesic is the shortest path between two points on the Earth's surface. The geodesic curve is constructed assuming the Earth is a sphere.
Methods that modify a Polyline must be called on the main thread. If not, an IllegalStateException will be thrown at runtime.
ExampleMap map; // ... get a map. Vector points = new Vector(); points.add(new Location(51.5, -0.1)); points.add(new Location(40.7, -74.0)); // Add a thin red line from London to New York. Polyline line = map.add(new Polyline().setPoints(points).setWidth(5).setColor(Color.RED));
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Polyline() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Color |
getColor()
Gets the color of this polyline.
| ||||||||||
Vector |
getPoints()
Returns a snapshot of the vertices of this polyline at this time .
| ||||||||||
int |
getWidth()
Gets the width of this polyline.
| ||||||||||
boolean |
isGeodesic()
Gets whether each segment of the line is drawn as a geodesic or not.
| ||||||||||
void |
setColor(Color color)
Sets the color of this polyline.
| ||||||||||
void |
setGeodesic(boolean geodesic)
Sets whether to draw each segment of the line as a geodesic or not.
| ||||||||||
void |
setPoints(Vector points)
Sets the points of this polyline.
| ||||||||||
void |
setVisible(boolean visible)
Sets the visibility of this polyline.
| ||||||||||
void |
setWidth(int width)
Sets the width of this polyline.
| ||||||||||
void |
setZIndex(int zIndex)
Sets the z-index of this polyline.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Returns a snapshot of the vertices of this polyline at this time .
The list returned is a copy of the list of vertices and so changes to the polyline's vertices will not be reflected by this list, nor will changes to this list be reflected by the polyline. To change the vertices of the polyline, call setPoints(List).
Gets the width of this polyline.
Gets whether each segment of the line is drawn as a geodesic or not.
Sets the color of this polyline.
color | of this polyline. |
---|
Sets whether to draw each segment of the line as a geodesic or not.
Supported only on the Android
platform.
geodesic | whether to draw each segment of the line as a geodesic or not. |
---|
Sets the points of this polyline.
This method will take a copy of the points, so further mutations to points will have no effect on this polyline.
points | a list of Location that are the vertices of the polyline. |
---|
Sets the visibility of this polyline.
visible | if true, then the polyline is visible; if false, it is not. |
---|
Sets the width of this polyline.
width | the width in screen pixels |
---|
Sets the z-index of this polyline.
zIndex | the z-index of this polyline. |
---|