public final class

PolylineOptions

extends Object
java.lang.Object
   ↳ com.amazon.geo.mapsv2.model.PolylineOptions

Class Overview

An object for defining the initial options for a Polyline object. Use this to define all the properties of a Polyline before calling the addPolyline(PolylineOptions) method to add the Polyline to the map.

Modifying PolylineOptions after the Polyline has been added to the map has no effect on the appearance of the Polyline.

Note that PolylineOptions methods do not need to be called on the main thread.

Summary

Public Constructors
PolylineOptions()
Creates a new PolylineOptions object with default values.
Public Methods
PolylineOptions add(LatLng... points)
Adds multiple vertices to the end of the new Polyline.
PolylineOptions add(LatLng point)
Adds a vertex to the end of the new Polyline.
PolylineOptions addAll(Iterable<LatLng> points)
Adds all vertices in points to the end of the new Polyline.
PolylineOptions color(int color)
Sets the color to use for the new Polyline in ARGB format.
int describeContents()
boolean equals(Object obj)
PolylineOptions geodesic(boolean geodesic)
Sets whether the line segments for the new Polyline are drawn geodesic or non-geodesic.

Geodesic is not supported in Amazon Maps API v2.5

int getColor()
Gets the stroke color to use for the new Polyline.
List<LatLng> getPoints()
Gets the list of the vertices to use to represent the new Polyline.
float getWidth()
Gets the stroke width to use for the new Polyline.
float getZIndex()
Gets the z-index to use for the new Polyline.
int hashCode()
boolean isGeodesic()
Retrieves a boolean value indicating whether the new Polyline line segments 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

boolean isVisible()
Retrieves a boolean value indicating whether the new Polyline is visible or hidden.
PolylineOptions visible(boolean visible)
Sets the visibility to use for the new Polyline.
PolylineOptions width(float width)
Sets the stroke width to use for the new Polyline in screen pixels.
void writeToParcel(Parcel out, int flags)
PolylineOptions zIndex(float zIndex)
Sets the z-index to use for the new the Polyline.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PolylineOptions ()

Creates a new PolylineOptions object with default values.

Public Methods

public PolylineOptions add (LatLng... points)

Adds multiple vertices to the end of the new Polyline.

Parameters
points The vertices to add as multiple LatLng objects. Must not be null.
Returns
  • This PolylineOptions object.

public PolylineOptions add (LatLng point)


This method is still under development and the API is subject to change or removal at any time without notice.
The API may change on your device if it is flashed with a new build or receives an OTA update.

Adds a vertex to the end of the new Polyline.

Parameters
point The vertex to add as a LatLng object. Must not be null.
Returns
  • This PolylineOptions object.

public PolylineOptions addAll (Iterable<LatLng> points)

Adds all vertices in points to the end of the new Polyline.

Parameters
points An Iterable of LatLng objects to add. Must not be null.
Returns
  • This PolylineOptions object.

public PolylineOptions color (int color)

Sets the color to use for the new Polyline in ARGB format. No line is drawn if this is set to TRANSPARENT. The default value is BLACK.

Parameters
color The color in ARGB format. See Color for more details.
Returns
  • This PolylineOptions object.

public int describeContents ()

public boolean equals (Object obj)

public PolylineOptions geodesic (boolean geodesic)

Sets whether the line segments for the new 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

Parameters
geodesic true to draw geodesic line segments, or false to draw straight lines on the map.
Returns
  • This PolylineOptions object.

public int getColor ()

Gets the stroke color to use for the new Polyline.

Returns
  • The Polyline's stroke color in ARGB format. See Color for more details.

public List<LatLng> getPoints ()

Gets the list of the vertices to use to represent the new Polyline.

Returns
  • A list of LatLng objects that represents the Polyline.

public float getWidth ()

Gets the stroke width to use for the new Polyline.

Returns
  • The Polyline's width in screen pixels.

public float getZIndex ()

Gets the z-index to use for the new Polyline.

Returns
  • The Polyline's z-index.

public int hashCode ()

public boolean isGeodesic ()

Retrieves a boolean value indicating whether the new Polyline line segments 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

Returns
  • true if each segment is drawn geodesic, or false if each segment is drawn as a straight line.

public boolean isVisible ()

Retrieves a boolean value indicating whether the new Polyline is visible or hidden.

Returns
  • true if the Polyline is visible, or false if it is invisible.

public PolylineOptions visible (boolean visible)

Sets the visibility to use for the new Polyline. The default value is true.

Parameters
visible true to make the Polyline visible, or false to make it invisible.
Returns
  • This PolylineOptions object.

public PolylineOptions width (float width)

Sets the stroke width to use for the new Polyline in screen pixels. Must be zero or greater. Setting a negative stroke width causes addPolyline(PolylineOptions) to throw an IllegalArgumentException. No line is drawn if the stroke width is set to zero. The default value is 10.

Parameters
width The stroke width of the new Polyline in screen pixels.
Returns
  • This PolylineOptions object

public void writeToParcel (Parcel out, int flags)

public PolylineOptions zIndex (float zIndex)

Sets the z-index to use for the new 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.

Parameters
zIndex The z-index for the new Polyline.
Returns
  • This PolylineOptions object.