目录

public class PolylineOptions

实现了Parcelable,定义了折线的有关选项。

Public Fields

无

Constructor

Construction Method
PolylineOptions()

Public Method Summary

Return typeMethod name
PolylineOptionscreateFromParcel(Parcel in)
PolylineOptions[]newArray(int size)
voidwriteToParcel(Parcel parcel, int flags)
PolylineOptionsadd(LatLng… points)
PolylineOptionsadd(LatLng point)
PolylineOptionsaddAll(Iterable<LatLng> points)
PolylineOptionsclickable(boolean clickable)
PolylineOptionscolor(int color)
PolylineOptionsendCap(Cap endCap)
PolylineOptionsgeodesic(boolean geodesic)
intgetColor()
CapgetEndCap()
intgetJointType()
List<PatternItem>getPattern()
List<LatLng>getPoints()
CapgetStartCap()
floatgetWidth()
floatgetZIndex()
booleanisClickable()
booleanisGeodesic()
booleanisVisible()
PolylineOptionsjointType(int jointType)
PolylineOptionspattern(List<PatternItem> pattern)
PolylineOptionsstartCap(Cap startCap)
PolylineOptionsvisible(boolean visible)
PolylineOptionswidth(float width)
PolylineOptionszIndex(float zIndex)

Public Methods

Method
public PolylineOptions add(LatLng… points)
开发者调用此API可以添加数个顶点到折线。


Parameters:

Parameter nameParameter desc
points若干点的位置信息。


Return:

Return typeParameter desc
PolylineOptions包含指定的一些顶点的PolylineOptions对象。
Method
public PolylineOptions add(LatLng point)
开发者调用此API可以添加单个顶点到折线。


Parameters:

Parameter nameParameter desc
point点的位置信息。


Return:

Return typeParameter desc
PolylineOptions设置新的顶点后的PolylineOptions对象。
Method
public PolylineOptions addAll(Iterable<LatLng> points)
开发者调用此API可以添加一组顶点到折线。


Parameters:

Parameter nameParameter desc
points一组顶点。


Return:

Return typeParameter desc
PolylineOptions包含一组顶点的PolylineOptions对象。
Method
public PolylineOptions clickable(boolean clickable)
开发者调用此API可以设置折线的可点击性。


Parameters:

Parameter nameParameter desc
clickable可点击性,true为可点击,false为不可点击,默认值为false。


Return:

Return typeParameter desc
PolylineOptions设置新的可点击性后的PolylineOptions对象。
Method
public PolylineOptions color(int color)
开发者调用此API可以设置折线的颜色。


Parameters:

Parameter nameParameter desc
colorARGB格式颜色值,默认值为黑色(0xff000000)。


Return:

Return typeParameter desc
PolylineOptions设置新的折线颜色后的PolylineOptions对象。
Method
public PolylineOptions endCap(Cap endCap)
开发者调用此API可以设置折线的末尾端点,默认末尾端点为ButtCap。


Parameters:

Parameter nameParameter desc
endCap末尾端点。


Return:

Return typeParameter desc
PolylineOptions设置新的末尾端点后的PolylineOptions对象。
Method
public PolylineOptions geodesic(boolean geodesic)
开发者调用此API可以设置是否将折线的每个线段绘制为大地线。


Parameters:

Parameter nameParameter desc
geodesic如果为true,则每段绘制为大地线;如果为false,则不是大地线。


Return:

Return typeParameter desc
PolylineOptions设置新的geodesic属性后的PolylineOptions对象。
Method
public int getColor()
开发者调用此API可以获取折线的颜色。


Parameters:
无
Return:

Return typeParameter desc
intARGB格式颜色值,默认值为黑色(0xff000000)。
Method
public Cap getEndCap()
开发者调用此API可以获取折线的末尾端点。


Parameters:
无
Return:

Return typeParameter desc
Cap折线的末尾端点。
Method
public int getJointType() 
开发者调用此API可以获取折线除起始和结束顶点之外的所有顶点的节点类型。


Parameters:
无
Return:

Return typeParameter desc
int折线的节点类型,默认值为DEFAULT。
Method
public List<PatternItem> getPattern()
开发者调用此API可以获取折线的样式。


Parameters:
无
Return:

Return typeParameter desc
List<PatternItem>折线的样式。
Method
public List<LatLng> getPoints()
开发者调用此API可以获取折线的所有顶点。


Parameters:
无
Return:

Return typeParameter desc
List<LatLng>折线所有顶点的集合。
Method
public Cap getStartCap()
开发者调用此API可以获取折线的起始端点。


Parameters:
无
Return:

Return typeParameter desc
Cap折线的起始端点
Method
public float getWidth()
开发者调用此API可以获取折线的宽度。


Parameters:
无
Return:

Return typeParameter desc
float

折线的宽度,以像素为单位。

注意:
此接口返回的折线宽度为实际宽度的1/3。
Method
public float getZIndex()
开发者调用此API可以获取折线的z指数。


Parameters:
无
Return:

Return typeParameter desc
floatz指数,即折线的叠加顺序。
Method
public boolean isClickable()
开发者调用此API可以获取折线的可点击性。


Parameters:
无
Return:

Return typeParameter desc
boolean折线的可点击性,true为可点击,false为不可点击。
Method
public boolean isGeodesic()
开发者调用此API可以获取是否将折线的每个线段绘制为大地线。


Parameters:
无
Return:

Return typeParameter desc
boolean如果每条线段都绘制为大地线,则返回true;反之,则返回false。
Method
public boolean isVisible()
开发者调用此API可以获取折线的可见性。


Parameters:
无
Return:

Return typeParameter desc
boolean折线的可见性,true为可见,false为不可见。
Method
public PolylineOptions jointType(int jointType)
设置折线除起始和结束顶点之外的所有顶点的节点类型,有关允许的值,请参见JointType。如果节点类型未定义或不是允许值之一,则将使用默认值DEFAULT。


Parameters:

Parameter nameParameter desc
jointType节点类型,默认值为DEFAULT。


Return:

Return typeParameter desc
PolylineOptions设置新的节点类型后的PolylineOptions对象。
Method
public PolylineOptions pattern(List<PatternItem> pattern)
开发者调用此API可以设置折线的样式,默认的样式为实心,表示null。


Parameters:

Parameter nameParameter desc
patternPatternItem对象的集合。


Return:

Return typeParameter desc
PolylineOptions设置新的样式后的PolylineOptions对象。
Method
public PolylineOptions startCap(Cap startCap)
开发者调用此API可以设置折线的起始端点,默认起始端点为ButtCap。


Parameters:

Parameter nameParameter desc
startCap起始端点。


Return:

Return typeParameter desc
PolylineOptions设置新的起始端点后的PolylineOptions对象。
Method
public PolylineOptions visible(boolean visible)
开发者调用此API可以设置折线的可见性,如果折线不可见,则不会绘制,其他所有状态均保留。


Parameters:

Parameter nameParameter desc
visible折线的可见性,默认为true。


Return:

Return typeParameter desc
PolylineOptions设置新的可见性后的PolylineOptions对象。
Method
public PolylineOptions width(float width)
开发者调用此API可以设置折线的宽度。


Parameters:

Parameter nameParameter desc
width

折线的宽度,以像素为单位,默认值为10像素。

注意:
为兼容性考虑,此接口设置的折线实际宽度为设置值width的三倍。


Return:

Return typeParameter desc
PolylineOptions设置新的折线宽度后的PolylineOptions对象。
Method
public PolylineOptions zIndex(float zIndex)
用于设置折线的z指数。z指数指的是折线的叠加顺序,具有较大z指数的折线会绘制在具有较小z指数的折线上,具有相同z指数的叠加顺序是任意的。默认的z指数是0。


Parameters:

Parameter nameParameter desc
zIndexz指数,即折线的叠加顺序。


Return:

Return typeParameter desc
PolylineOptions设置新的z指数后的PolylineOptions对象。