implements Parcelable
Defines options for a polyline.
Developer Guide
For more information, read the Shapes developer guide.
Inherited Constant Summary
Public Constructor Summary
Public Method Summary
PolylineOptions | |
PolylineOptions | |
PolylineOptions | |
PolylineOptions | |
PolylineOptions | |
PolylineOptions | |
PolylineOptions |
clickable(boolean clickable)
Specifies whether this polyline is clickable.
|
PolylineOptions |
color(int color)
Sets the color of the polyline as a 32-bit ARGB color.
|
PolylineOptions | |
PolylineOptions |
geodesic(boolean geodesic)
Specifies whether to draw each segment of this polyline as a geodesic.
|
int |
getColor()
Gets the color set for this
PolylineOptions object. |
Cap |
getEndCap()
Gets the cap set for the end vertex in this
PolylineOptions object. |
int |
getJointType()
Gets the joint type set in this
PolylineOptions object for all vertices except the
start and end vertices. |
List<PatternItem> |
getPattern()
Gets the stroke pattern set in this
PolylineOptions object for the polyline. |
List<LatLng> |
getPoints()
Gets the points set for this
PolylineOptions object. |
Cap |
getStartCap()
Gets the cap set for the start vertex in this
PolylineOptions object. |
float |
getWidth()
Gets the width set for this
PolylineOptions object. |
float |
getZIndex()
Gets the zIndex set for this
PolylineOptions object. |
boolean |
isClickable()
Gets the clickability setting for this
PolylineOptions object. |
boolean |
isGeodesic()
Gets the geodesic setting for this
PolylineOptions object. |
boolean |
isVisible()
Gets the visibility setting for this
PolylineOptions object. |
PolylineOptions |
jointType(int jointType)
Sets the joint type for all vertices of the polyline except the start and end vertices.
|
PolylineOptions | |
PolylineOptions | |
PolylineOptions |
visible(boolean visible)
Specifies the visibility for the polyline.
|
PolylineOptions |
width(float width)
Sets the width of the polyline in screen pixels.
|
PolylineOptions |
zIndex(float zIndex)
Specifies the polyline's zIndex, i.e., the order in which it will be drawn.
|
Inherited Method Summary
Public Constructors
public PolylineOptions ()
Public Methods
public PolylineOptions add (LatLng... points)
Adds vertices to the end of the polyline being built.
Parameters
points |
---|
Returns
- this
PolylineOptions
object with the given points on the end.
public PolylineOptions add (LatLng point)
Adds a vertex to the end of the polyline being built.
Parameters
point |
---|
Returns
- this
PolylineOptions
object with the given point on the end.
public PolylineOptions addAll (Iterable<LatLng> points)
Adds vertices to the end of the polyline being built.
Parameters
points |
---|
Returns
- this
PolylineOptions
object with the given points on the end.
public PolylineOptions addAllSpans (Iterable<StyleSpan> spans)
Adds new style spans to the polyline being built.
Parameters
spans | the style spans that will be added to the polyline. |
---|
Returns
- this
PolylineOptions
object with new style spans added.
public PolylineOptions addSpan (StyleSpan span)
Adds a new style span to the polyline being built.
Parameters
span | the style span that will be added to the polyline. |
---|
Returns
- this
PolylineOptions
object with new style span added.
public PolylineOptions addSpan (StyleSpan... spans)
Adds new style spans to the polyline being built.
Parameters
spans | the style spans that will be added to the polyline. |
---|
Returns
- this
PolylineOptions
object with new style spans added.
public PolylineOptions clickable (boolean clickable)
Specifies whether this polyline is clickable. The default setting is false
Parameters
clickable |
---|
Returns
- this
PolylineOptions
object with a new clickability setting.
public PolylineOptions color (int color)
Sets the color of the polyline as a 32-bit ARGB color. The default color is black ( 0xff000000
).
Parameters
color |
---|
Returns
- this
PolylineOptions
object with a new color set.
public PolylineOptions endCap (Cap endCap)
Sets the cap at the end vertex of the polyline. The default end cap is ButtCap
.
Parameters
endCap |
---|
Returns
- this
PolylineOptions
object with a new end cap set.
public PolylineOptions geodesic (boolean geodesic)
Specifies whether to draw each segment of this polyline as a geodesic. The default setting is
false
Parameters
geodesic |
---|
Returns
- this
PolylineOptions
object with a new geodesic setting.
public int getColor ()
Gets the color set for this PolylineOptions
object.
Returns
- the color of the polyline in ARGB format.
public Cap getEndCap ()
Gets the cap set for the end vertex in this PolylineOptions
object.
Returns
- the end cap of the polyline.
public int getJointType ()
Gets the joint type set in this PolylineOptions
object for all vertices except the
start and end vertices. See JointType
for possible values.
Returns
- the joint type of the polyline.
public List<PatternItem> getPattern ()
Gets the stroke pattern set in this PolylineOptions
object for the polyline.
Returns
- the stroke pattern of the polyline.
public List<LatLng> getPoints ()
Gets the points set for this PolylineOptions
object.
Returns
- the list of
LatLng
s specifying the vertices of the polyline.
public Cap getStartCap ()
Gets the cap set for the start vertex in this PolylineOptions
object.
Returns
- the start cap of the polyline.
public float getWidth ()
Gets the width set for this PolylineOptions
object.
Returns
- the width of the polyline in screen pixels.
public float getZIndex ()
Gets the zIndex set for this PolylineOptions
object.
Returns
- the zIndex of the polyline.
public boolean isClickable ()
Gets the clickability setting for this PolylineOptions
object.
Returns
true
if the polyline is clickable;false
if it is not.
public boolean isGeodesic ()
Gets the geodesic setting for this PolylineOptions
object.
Returns
true
if the polyline segments should be geodesics;false
they should not be.
public boolean isVisible ()
Gets the visibility setting for this PolylineOptions
object.
Returns
true
if the polyline is visible;false
if it is not.
public PolylineOptions jointType (int jointType)
Sets the joint type for all vertices of the polyline except the start and end vertices.
See JointType
for allowed values. The default value DEFAULT
will
be used if joint type is undefined or is not one of the allowed values.
Parameters
jointType |
---|
Returns
- this
PolylineOptions
object with a new joint type set.
public PolylineOptions pattern (List<PatternItem> pattern)
Sets the stroke pattern for the polyline. The default stroke pattern is solid, represented by
null
.
Parameters
pattern |
---|
Returns
- this
PolylineOptions
object with a new stroke pattern set.
public PolylineOptions startCap (Cap startCap)
Sets the cap at the start vertex of the polyline. The default start cap is ButtCap
.
Parameters
startCap |
---|
Returns
- this
PolylineOptions
object with a new start cap set.
public PolylineOptions visible (boolean visible)
Specifies the visibility for the polyline. The default visibility is true
.
Parameters
visible |
---|
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.
Parameters
width |
---|
Returns
- this
PolylineOptions
object with a new width set.
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.
Parameters
zIndex |
---|
Returns
- this
PolylineOptions
object with a new zIndex set.