PolylineOptions | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Languages
close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
Summary: Constants | Inherited Constants | Fields | Ctors | Methods | Inherited Methods | [Expand All]
public final class

# PolylineOptions

extends Object
implements Parcelable

java.lang.Object
↳ | com.google.android.gms.maps.model.PolylineOptions

## Class Overview

Defines options for a polyline.

## Summary

Constants
String | NULL |

[Expand] Inherited Constants
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final PolylineOptionsCreator | CREATOR |

Public Constructors
| PolylineOptions()

Public Methods
PolylineOptions | add(LatLng point) Adds a vertex to the end of the polyline being built.
PolylineOptions | add(LatLng... points) Adds vertices to the end of the polyline being built.
PolylineOptions | addAll(Iterable<LatLng> points) Adds vertices to the end of the polyline being built.
PolylineOptions | color(int color) Sets the color of the polyline as a 32-bit ARGB color.
int | describeContents()
PolylineOptions | geodesic(boolean geodesic) Specifies whether to draw each segment of this polyline as a geodesic.
int | getColor() Gets the color set for this Options object.
List<LatLng> | getPoints() Gets the points set for this Options object.
float | getWidth() Gets the width set for this Options object.
float | getZIndex() Gets the zIndex set for this Options object.
boolean | isGeodesic() Gets the geodesic setting for this Options object.
boolean | isVisible() Gets the visibility setting for this Options object.
PolylineOptions | visible(boolean visible) Specifies the visibility for the polyline.
PolylineOptions | width(float width) Sets the width of the polyline in screen pixels.
void | writeToParcel(Parcel out, int flags)
PolylineOptions | zIndex(float zIndex) Specifies the polyline's zIndex, i.e., the order in which it will be drawn.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## Constants

#### public static final String NULL

Constant Value: "SAFE_PARCELABLE_NULL_STRING"

## Fields

#### public static final PolylineOptionsCreator CREATOR

## Public Constructors

#### public PolylineOptions ()

## Public Methods

#### public PolylineOptions add (LatLng point)

Adds a vertex to the end of the polyline being built.

##### Returns

- this `PolylineOptions` object with the given point on the end.

#### public PolylineOptions add (LatLng... points)

Adds vertices to the end of the polyline being built.

##### Returns

- this `PolylineOptions` object with the given points on the end.

#### public PolylineOptions addAll (Iterable<LatLng> points)

Adds vertices to the end of the polyline being built.

##### Returns

- this `PolylineOptions` object with the given points on the end.

#### public PolylineOptions color (int color)

Sets the color of the polyline as a 32-bit ARGB color. The default color is black ( `0xff000000`).

##### Returns

- this `PolylineOptions` object with a new color set.

#### public int describeContents ()

#### public PolylineOptions geodesic (boolean geodesic)

Specifies whether to draw each segment of this polyline as a geodesic. The default setting is `false`

##### Returns

- this `PolylineOptions` object with a new geodesic setting.

#### public int getColor ()

Gets the color set for this Options object.

##### Returns

- the color of the polyline in ARGB format.

#### public List<LatLng> getPoints ()

Gets the points set for this Options object.

##### Returns

- the list of `LatLng`s specifying the vertices of the polyline.

#### public float getWidth ()

Gets the width set for this Options object.

##### Returns

- the width of the polyline in screen pixels.

#### public float getZIndex ()

Gets the zIndex set for this Options object.

##### Returns

- the zIndex of the polyline.

#### public boolean isGeodesic ()

Gets the geodesic setting for this Options object.

##### Returns

- `true` if the polyline segments should be geodesics; `false` they should not be.

#### public boolean isVisible ()

Gets the visibility setting for this Options object.

##### Returns

- `true` if the polyline is to be visible; `false` if it is not.

#### public PolylineOptions visible (boolean visible)

Specifies the visibility for the polyline. The default visibility is `true`.

##### Returns

- this `PolylineOptions` object with a new visibility setting.

#### public PolylineOptions width (float width)

Sets the width of the polyline in screen pixels. The default is 10.

##### Returns

- this `PolylineOptions` object with a new width set.

#### public void writeToParcel (Parcel out, int flags)

#### public PolylineOptions zIndex (float zIndex)

Specifies the polyline's zIndex, i.e., the order in which it will be drawn. See the documentation at the top of this class for more information about zIndex.

##### Returns

- this `PolylineOptions` object with a new zIndex set.