public class PolylineOptions
实现了Parcelable,定义了折线的有关选项。
无
| Construction Method |
| PolylineOptions() |
| Return type | Method name |
| PolylineOptions | createFromParcel(Parcel in) |
| PolylineOptions[] | newArray(int size) |
| void | writeToParcel(Parcel parcel, int flags) |
| PolylineOptions | add(LatLng… points) |
| PolylineOptions | add(LatLng point) |
| PolylineOptions | addAll(Iterable<LatLng> points) |
| PolylineOptions | clickable(boolean clickable) |
| PolylineOptions | color(int color) |
| PolylineOptions | endCap(Cap endCap) |
| PolylineOptions | geodesic(boolean geodesic) |
| int | getColor() |
| Cap | getEndCap() |
| int | getJointType() |
| List<PatternItem> | getPattern() |
| List<LatLng> | getPoints() |
| Cap | getStartCap() |
| float | getWidth() |
| float | getZIndex() |
| boolean | isClickable() |
| boolean | isGeodesic() |
| boolean | isVisible() |
| PolylineOptions | jointType(int jointType) |
| PolylineOptions | pattern(List<PatternItem> pattern) |
| PolylineOptions | startCap(Cap startCap) |
| PolylineOptions | visible(boolean visible) |
| PolylineOptions | width(float width) |
| PolylineOptions | zIndex(float zIndex) |
| Method |
| public PolylineOptions add(LatLng… points) |
| 开发者调用此API可以添加数个顶点到折线。 |
Parameters:
| Parameter name | Parameter desc |
| points | 若干点的位置信息。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 包含指定的一些顶点的PolylineOptions对象。 |
| Method |
| public PolylineOptions add(LatLng point) |
| 开发者调用此API可以添加单个顶点到折线。 |
Parameters:
| Parameter name | Parameter desc |
| point | 点的位置信息。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的顶点后的PolylineOptions对象。 |
| Method |
| public PolylineOptions addAll(Iterable<LatLng> points) |
| 开发者调用此API可以添加一组顶点到折线。 |
Parameters:
| Parameter name | Parameter desc |
| points | 一组顶点。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 包含一组顶点的PolylineOptions对象。 |
| Method |
| public PolylineOptions clickable(boolean clickable) |
| 开发者调用此API可以设置折线的可点击性。 |
Parameters:
| Parameter name | Parameter desc |
| clickable | 可点击性,true为可点击,false为不可点击,默认值为false。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的可点击性后的PolylineOptions对象。 |
| Method |
| public PolylineOptions color(int color) |
| 开发者调用此API可以设置折线的颜色。 |
Parameters:
| Parameter name | Parameter desc |
| color | ARGB格式颜色值,默认值为黑色(0xff000000)。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的折线颜色后的PolylineOptions对象。 |
| Method |
| public PolylineOptions endCap(Cap endCap) |
| 开发者调用此API可以设置折线的末尾端点,默认末尾端点为ButtCap。 |
Parameters:
| Parameter name | Parameter desc |
| endCap | 末尾端点。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的末尾端点后的PolylineOptions对象。 |
| Method |
| public PolylineOptions geodesic(boolean geodesic) |
| 开发者调用此API可以设置是否将折线的每个线段绘制为大地线。 |
Parameters:
| Parameter name | Parameter desc |
| geodesic | 如果为true,则每段绘制为大地线;如果为false,则不是大地线。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的geodesic属性后的PolylineOptions对象。 |
| Method |
| public int getColor() |
| 开发者调用此API可以获取折线的颜色。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| int | ARGB格式颜色值,默认值为黑色(0xff000000)。 |
| Method |
| public Cap getEndCap() |
| 开发者调用此API可以获取折线的末尾端点。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| Cap | 折线的末尾端点。 |
| Method |
| public int getJointType() |
| 开发者调用此API可以获取折线除起始和结束顶点之外的所有顶点的节点类型。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| int | 折线的节点类型,默认值为DEFAULT。 |
| Method |
| public List<PatternItem> getPattern() |
| 开发者调用此API可以获取折线的样式。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| List<PatternItem> | 折线的样式。 |
| Method |
| public List<LatLng> getPoints() |
| 开发者调用此API可以获取折线的所有顶点。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| List<LatLng> | 折线所有顶点的集合。 |
| Method |
| public Cap getStartCap() |
| 开发者调用此API可以获取折线的起始端点。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| Cap | 折线的起始端点 |
| Method |
| public float getWidth() |
| 开发者调用此API可以获取折线的宽度。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | 折线的宽度,以像素为单位。 注意: 此接口返回的折线宽度为实际宽度的1/3。 |
| Method |
| public float getZIndex() |
| 开发者调用此API可以获取折线的z指数。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| float | z指数,即折线的叠加顺序。 |
| Method |
| public boolean isClickable() |
| 开发者调用此API可以获取折线的可点击性。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| boolean | 折线的可点击性,true为可点击,false为不可点击。 |
| Method |
| public boolean isGeodesic() |
| 开发者调用此API可以获取是否将折线的每个线段绘制为大地线。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| boolean | 如果每条线段都绘制为大地线,则返回true;反之,则返回false。 |
| Method |
| public boolean isVisible() |
| 开发者调用此API可以获取折线的可见性。 |
Parameters:
无
Return:
| Return type | Parameter desc |
| boolean | 折线的可见性,true为可见,false为不可见。 |
| Method |
| public PolylineOptions jointType(int jointType) |
| 设置折线除起始和结束顶点之外的所有顶点的节点类型,有关允许的值,请参见JointType。如果节点类型未定义或不是允许值之一,则将使用默认值DEFAULT。 |
Parameters:
| Parameter name | Parameter desc |
| jointType | 节点类型,默认值为DEFAULT。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的节点类型后的PolylineOptions对象。 |
| Method |
| public PolylineOptions pattern(List<PatternItem> pattern) |
| 开发者调用此API可以设置折线的样式,默认的样式为实心,表示null。 |
Parameters:
| Parameter name | Parameter desc |
| pattern | PatternItem对象的集合。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的样式后的PolylineOptions对象。 |
| Method |
| public PolylineOptions startCap(Cap startCap) |
| 开发者调用此API可以设置折线的起始端点,默认起始端点为ButtCap。 |
Parameters:
| Parameter name | Parameter desc |
| startCap | 起始端点。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的起始端点后的PolylineOptions对象。 |
| Method |
| public PolylineOptions visible(boolean visible) |
| 开发者调用此API可以设置折线的可见性,如果折线不可见,则不会绘制,其他所有状态均保留。 |
Parameters:
| Parameter name | Parameter desc |
| visible | 折线的可见性,默认为true。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的可见性后的PolylineOptions对象。 |
| Method |
| public PolylineOptions width(float width) |
| 开发者调用此API可以设置折线的宽度。 |
Parameters:
| Parameter name | Parameter desc |
| width | 折线的宽度,以像素为单位,默认值为10像素。 注意: 为兼容性考虑,此接口设置的折线实际宽度为设置值width的三倍。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的折线宽度后的PolylineOptions对象。 |
| Method |
| public PolylineOptions zIndex(float zIndex) |
| 用于设置折线的z指数。z指数指的是折线的叠加顺序,具有较大z指数的折线会绘制在具有较小z指数的折线上,具有相同z指数的叠加顺序是任意的。默认的z指数是0。 |
Parameters:
| Parameter name | Parameter desc |
| zIndex | z指数,即折线的叠加顺序。 |
Return:
| Return type | Parameter desc |
| PolylineOptions | 设置新的z指数后的PolylineOptions对象。 |