public class PolylineOptions
Implements the Parcelable API and defines attributes for a polyline.
None.
| 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) |
| Adds multiple vertices to a polyline. |
Parameters:
| Parameter name | Parameter desc |
| points | Coordinates of multiple vertices. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with multiple specified vertices. |
| Method |
| public PolylineOptions add(LatLng point) |
| Adds a vertex to a polyline. |
Parameters:
| Parameter name | Parameter desc |
| point | Coordinates of a vertex. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new vertex. |
| Method |
| public PolylineOptions addAll(Iterable<LatLng> points) |
| Adds multiple vertices to a polyline. |
Parameters:
| Parameter name | Parameter desc |
| points | Multiple vertices. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with multiple specified vertices. |
| Method |
| public PolylineOptions clickable(boolean clickable) |
| Specifies whether a polyline is tappable. |
Parameters:
| Parameter name | Parameter desc |
| clickable | Indicates whether a polyline is tappable. The options are true (yes) and false (no). The default value is false. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new tappability setting. |
| Method |
| public PolylineOptions color(int color) |
| Sets the stroke color of a polyline. |
Parameters:
| Parameter name | Parameter desc |
| color | Color in ARGB format. By default, the stroke color is black (0xff000000). |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new stroke color. |
| Method |
| public PolylineOptions endCap(Cap endCap) |
| Sets the end vertex of a polyline. By default, the end vertex is a ButtCap object. |
Parameters:
| Parameter name | Parameter desc |
| endCap | End vertex of a polyline. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new end vertex. |
| Method |
| public PolylineOptions geodesic(boolean geodesic) |
| Specifies whether to draw each segment of a polyline as a geodesic. |
Parameters:
| Parameter name | Parameter desc |
| geodesic | Indicates whether to draw each segment of a polyline as a geodesic. The options are true (yes) and false (no). |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new geodesic setting. |
| Method |
| public int getColor() |
| Obtains the stroke color of a polyline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| int | Color in ARGB format. By default, the stroke color is black (0xff000000). |
| Method |
| public Cap getEndCap() |
| Obtains the end vertex of a polyline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| Cap | End vertex of a polyline. |
| Method |
| public int getJointType() |
| Obtains the joint type of all vertices of a polyline, except the start and end vertices. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| int | Joint type of a polyline. The default value is DEFAULT. |
| Method |
| public List<PatternItem> getPattern() |
| Obtains the stroke pattern of a polyline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| List<PatternItem> | Stroke pattern of a polyline. |
| Method |
| public List<LatLng> getPoints() |
| Obtains a set of all vertices of a polyline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| List<LatLng> | Set of all vertices of a polyline. |
| Method |
| public Cap getStartCap() |
| Obtains the start vertex of a polyline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| Cap | Start vertex of a polyline. |
| Method |
| public float getWidth() |
| Obtains the stroke width of a polyline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| float | Stroke width of a polyline, in pixels. Notice: The stroke width returned by this API is one third of the actual width. |
| Method |
| public float getZIndex() |
| Obtains the z-index of a polyline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| float | Z-index, which indicates the overlapping order of a polyline. |
| Method |
| public boolean isClickable() |
| Checks whether a polyline is tappable. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| boolean | If a polyline is tappable, true is returned. Otherwise, false is returned. |
| Method |
| public boolean isGeodesic() |
| Checks whether each segment of a polyline is drawn as a geodesic. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| boolean | If each segment is drawn as a geodesic, true is returned. Otherwise, false is returned. |
| Method |
| public boolean isVisible() |
| Checks whether a polyline is visible. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| boolean | If a polyline is visible, true is returned. Otherwise, false is returned. |
| Method |
| public PolylineOptions jointType(int jointType) |
| Sets the joint type of all vertices of a polyline, except the start and end vertices. For details of the allowed joint types, please refer to JointType. If the joint type is not set or not an allowed one, the default value DEFAULT is used. |
Parameters:
| Parameter name | Parameter desc |
| jointType | Joint type. The default value is DEFAULT. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new joint type. |
| Method |
| public PolylineOptions pattern(List<PatternItem> pattern) |
| Sets the stroke pattern of a polyline. By default, the stroke pattern is solid, represented by null. |
Parameters:
| Parameter name | Parameter desc |
| pattern | PatternItem object set. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new stroke pattern. |
| Method |
| public PolylineOptions startCap(Cap startCap) |
| Sets the start vertex of a polyline. By default, the start vertex is a ButtCap object. |
Parameters:
| Parameter name | Parameter desc |
| startCap | Start vertex of a polyline. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new start vertex. |
| Method |
| public PolylineOptions visible(boolean visible) |
| Specifies whether a polyline is visible. If the polyline is invisible, it will not be drawn but all other states will be preserved. |
Parameters:
| Parameter name | Parameter desc |
| visible | Indicates whether a polyline is visible. The default value is true. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new visibility setting. |
| Method |
| public PolylineOptions width(float width) |
| Sets the stroke width of a polyline. |
Parameters:
| Parameter name | Parameter desc |
| width | Stroke width of a polyline, in pixels. The default value is 10. Notice: To ensure compatibility, the actual stroke width triples the passed parameter value. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new stroke width. |
Parameters:
| Parameter name | Parameter desc |
| zIndex | Z-index, which indicates the overlapping order of a polyline. |
Return:
| Return type | Parameter desc |
| PolylineOptions | PolylineOptions object with a new z-index. |