java.lang.Object | |
↳ | com.amazon.geo.mapsv2.model.Polyline |
A line overlay that can be drawn on the map. A Polyline
is a line
connecting a series of points on the map. Unlike a a Polygon
, a
Polyline
is not closed.
Obtain a Polyline
by creating a PolylineOptions
object with
the initial properties and then passing it to
addPolyline(PolylineOptions)
.
You can change the properties of the Polyline
using the setter
methods after the Polyline
is created. Note that all getter and
setter methods must be called on the main thread or an
IllegalStateException
is thrown.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the color of this
Polyline 's line segments. | |||||||||||
Gets the unique ID for this
Polyline . | |||||||||||
Gets a list of the geographic points that comprise the vertices of this
Polyline . | |||||||||||
Gets the stroke width of this
Polyline . | |||||||||||
Gets the z-index of this
Polyline . | |||||||||||
Retrieves a boolean value indicating whether the line segments for the
Polyline are drawn as geodesic (curved to correspond to the
shortest path between two points on the surface of the Earth) or as
straight lines.Geodesic is not supported in Amazon Maps API v2.5 | |||||||||||
Retrieves a boolean value indicating whether the
Polyline is
visible or hidden. | |||||||||||
Removes this
Polyline from the map. | |||||||||||
Sets the color for the
Polyline in ARGB format. | |||||||||||
Sets whether the line segments of this
Polyline are drawn
geodesic or non-geodesic.Geodesic is not supported in Amazon Maps API v2.5 | |||||||||||
Sets the vertices of this
Polyline . | |||||||||||
Sets the visibility of the
Polyline . | |||||||||||
Sets the stroke width of this
Polyline in screen pixels. | |||||||||||
Sets the z-index of the
Polyline . | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public constructor. Instead of using this constructor, use
AmazonMap.addPolyline(PolylineOptions)
to create a Polyline
.
Gets the color of this Polyline
's line segments.
Polyline
in ARGB format. See Color
for
more details.
Gets the unique ID for this Polyline
. The ID is unique for all
Polyline
objects currently added to the map. This method may be
called on a background thread.
Polyline
's ID as a String
.
Gets a list of the geographic points that comprise the vertices of this
Polyline
. Each point in the list is represented by a
LatLng
.
The returned list is a copy, so any subsequent changes to the vertices of
the Polyline
are not reflected in this list, and any changes
to this list do not change the appearance of the Polyline
. To
update the points of the Polyline
, use setPoints(List)
.
LatLng
objects representing the vertices for
this Polyline
.
Gets the stroke width of this Polyline
.
Polyline
's stroke width in screen pixels.
Gets the z-index of this Polyline
.
Polyline
's z-index.
Retrieves a boolean value indicating whether the line segments for the
Polyline
are drawn as geodesic (curved to correspond to the
shortest path between two points on the surface of the Earth) or as
straight lines.
Geodesic is not supported in Amazon Maps API v2.5
true
if each segment is drawn geodesic, or false
if each segment is drawn as a straight line. Checks if each line
segment is drawn geodesic.
Retrieves a boolean value indicating whether the Polyline
is
visible or hidden.
true
if this Polyline
is visible, or
false
if it is hidden.
Removes this Polyline
from the map. After calling this method,
calling other methods on the object has no effect on the appearance of
the map.
Sets whether the line segments of this Polyline
are drawn
geodesic or non-geodesic. The default is false
to draw straight
lines.
Geodesic line segments are drawn as a curve that corresponds to the shortest path between two points on the surface of the Earth. The curve is drawn assuming that the Earth is a sphere.
Non-geodesic line segments are drawn as straight lines on top of the map's projection.
Geodesic is not supported in Amazon Maps API v2.5
geodesic | true to draw geodesic line segments, or
false to draw straight lines on the map.
|
---|
Sets the vertices of this Polyline
. The list of points passed to
this method is copied, so modifying the contents of points
after
calling this method has no effect.
points | A list of LatLng objects that represent the
vertices of this Polyline . Must not be null or
empty.
|
---|
Sets the visibility of the Polyline
. If false
, the
Polyline
is hidden, but all state is preserved. The default value
is true
.
visible | true to make this Polyline visible, or
false to make it hidden.
|
---|
Sets the stroke width of this Polyline
in screen pixels. Must be
zero or greater. The line is not drawn if the width is set to zero. The
default value is 10.
width | The width of the Polyline in screen pixels. |
---|
IllegalArgumentException | if width is less than zero. |
---|
Sets the z-index of the Polyline
. Z-index determines the order in
which overlays are drawn. Overlays with higher indices are drawn over
overlays with lower indices. Overlays with the same z-index are drawn in
an arbitrary order.
Overlays that are affected by z-index include GroundOverlay
,
TileOverlay
, Circle
, Polyline
, and
Polygon
.
Marker
overlays are not affected by the z-index of other
overlays.
The default value is zero.
zIndex | The z-index. |
---|