public class PolygonOptions
Defines attributes for a Polygon.
None.
| Construction Method |
| PolygonOptions() |
| Return type | Method name |
| PolygonOptions | add(LatLng… points) |
| PolygonOptions | add(LatLng point) |
| PolygonOptions | addAll(Iterable<LatLng> points) |
| PolygonOptions | addHole(Iterable<LatLng> points) |
| PolygonOptions | clickable(boolean clickable) |
| PolygonOptions | fillColor(int color) |
| PolygonOptions | geodesic(boolean geodesic) |
| int | getFillColor() |
| List<List<LatLng>> | getHoles() |
| List<LatLng> | getPoints() |
| int | getStrokeColor() |
| int | getStrokeJointType() |
| List<PatternItem> | getStrokePattern() |
| float | getStrokeWidth() |
| float | getZIndex() |
| boolean | isClickable() |
| boolean | isGeodesic() |
| boolean | isVisible() |
| PolygonOptions | strokeColor(int color) |
| PolygonOptions | strokeJointType(int jointType) |
| PolygonOptions | strokePattern(List<PatternItem> pattern) |
| PolygonOptions | strokeWidth(float width) |
| PolygonOptions | visible(boolean visible) |
| PolygonOptions | zIndex(float zIndex) |
| Method |
| public PolygonOptions add(LatLng… points) |
| Sets multiple vertices of a polygon. |
Parameters:
| Parameter name | Parameter desc |
| points | Coordinates of multiple vertices. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with multiple specified vertices. |
| Method |
| public PolygonOptions add(LatLng point) |
| Adds a vertex to a polygon. |
Parameters:
| Parameter name | Parameter desc |
| point | Coordinates of a vertex. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a specified vertex. |
| Method |
| public PolygonOptions addAll(Iterable<LatLng> points) |
| Adds multiple vertices to a polygon. |
Parameters:
| Parameter name | Parameter desc |
| points | Multiple vertices. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with multiple specified vertices. |
| Method |
| public PolygonOptions addHole(Iterable<LatLng> points) |
| Adds multiple holes to a polygon. |
Parameters:
| Parameter name | Parameter desc |
| points | Multiple holes. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with multiple specified holes. |
| Method |
| public PolygonOptions clickable(boolean clickable) |
| Specifies whether a polygon is tappable. |
Parameters:
| Parameter name | Parameter desc |
| clickable | Indicates whether a polygon is tappable. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new tappability setting. |
| Method |
| public PolygonOptions fillColor(int color) |
| Sets the fill color of a polygon. |
Parameters:
| Parameter name | Parameter desc |
| color | Color in ARGB format. By default, the fill color is transparent (0x00000000). |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new fill color. |
| Method |
| public PolygonOptions geodesic(boolean geodesic) |
| Specifies whether to draw each segment of a polygon as a geodesic. |
Parameters:
| Parameter name | Parameter desc |
| geodesic | Indicates whether to draw each segment of a polygon as a geodesic. The options are true (yes) and false (no). |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new geodesic setting. |
| Method |
| public int getFillColor() |
| Obtains the fill color of a polygon. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| int | Color in ARGB format. |
| Method |
| public List<List<LatLng>> getHoles() |
| Obtains holes of a polygon on a map. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| List<List<LatLng>> | Holes of a polygon. |
| Method |
| public List<LatLng> getPoints() |
| Obtains a set of all vertices of a polygon. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| List<LatLng> | Set of all vertices of a polygon. |
| Method |
| public int getStrokeColor() |
| Obtains the stroke color of a polygon's outline, in ARGB format. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| int | Color in ARGB format. |
| Method |
| public int getStrokeJointType() |
| Obtains the joint type of a polygon. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| int | Joint type of a polygon. |
| Method |
| public List<PatternItem> getStrokePattern() |
| Obtains the stroke pattern of a polygon's outline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| List<PatternItem> | Stroke pattern of a polygon's outline. |
| Method |
| public float getStrokeWidth() |
| Obtains the stroke width of a polygon's outline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| float | Stroke width of a polygon's outline, in pixels. |
| Method |
| public float getZIndex() |
| Obtains the z-index of a polygon. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| float | Z-index, which indicates the overlapping order of a polygon. |
| Method |
| public boolean isClickable() |
| Checks whether a polygon is tappable. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| boolean | If a polygon is tappable, true is returned. Otherwise, false is returned. |
| Method |
| public boolean isGeodesic() |
| Checks whether each segment of a polygon 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 polygon is visible. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| boolean | If a polygon is visible, true is returned. Otherwise, false is returned. |
| Method |
| public PolygonOptions strokeColor(int color) |
| Sets the stroke color of a polygon's outline. |
Parameters:
| Parameter name | Parameter desc |
| color | Color in ARGB format. By default, the stroke color is black (0xff000000). |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new stroke color. |
| Method |
| public PolygonOptions strokeJointType(int jointType) |
| Sets the joint type of a polygon. |
Parameters:
| Parameter name | Parameter desc |
| jointType | Joint type. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new joint type. |
| Method |
| public PolygonOptions strokePattern(List<PatternItem> pattern) |
| Sets the stroke pattern of a polygon's outline. By default, the stroke pattern is solid, represented by null. |
Parameters:
| Parameter name | Parameter desc |
| pattern | PatternItem object set. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new stroke pattern. |
| Method |
| public PolygonOptions strokeWidth(float width) |
| Sets the stroke width of a polygon's outline. |
Parameters:
| Parameter name | Parameter desc |
| width | Stroke width of a polygon's outline, in pixels. The default value is 10. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new stroke width. |
| Method |
| public PolygonOptions visible(boolean visible) |
| Specifies whether a polygon is visible. If the polygon is invisible, it will not be drawn but all other states will be preserved. |
Parameters:
| Parameter name | Parameter desc |
| visible | Indicates whether a polygon is visible. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new visibility setting. |
Parameters:
| Parameter name | Parameter desc |
| zIndex | Z-index, which indicates the overlapping order of a polygon. |
Return:
| Return type | Parameter desc |
| PolygonOptions | PolygonOptions object with a new z-index. |