Class Info |
|---|
public class PolygonOptions Defines attributes for a Polygon object. |
Constructor Name |
|---|
PolygonOptions() Default constructor of the PolygonOptions class. |
Qualifier and Type | Method Name and Description |
|---|---|
PolygonOptions | Sets multiple vertices of a polygon. |
PolygonOptions | Adds a vertex to a polygon. |
PolygonOptions | addAll(Iterable<LatLng> points) Adds multiple vertices to a polygon. |
PolygonOptions | addHole(Iterable<LatLng> points) Adds multiple holes to a polygon. |
PolygonOptions | clickable(boolean clickable) Sets whether a polygon is tappable. |
PolygonOptions | fillColor(int color) Sets the fill color of a polygon. |
PolygonOptions | geodesic(boolean geodesic) Sets whether to draw each segment of a polygon as a geodesic. |
List<List<LatLng>> | getHoles() Obtains holes in a polygon on a map. |
List<LatLng> | Obtains all vertices of a polygon. |
List<PatternItem> | Obtains the stroke pattern of a polygon's outline. |
PolygonOptions | strokeColor(int color) Sets the stroke color of a polygon's outline. |
PolygonOptions | strokeJointType(int jointType) Sets the joint type of a polygon. |
PolygonOptions | strokePattern(List<PatternItem> pattern) Sets the stroke pattern of a polygon's outline. |
PolygonOptions | strokeWidth(float width) Sets the stroke width of a polygon's outline. |
PolygonOptions | visible(boolean visible) Sets whether a polygon is visible. |
PolygonOptions | zIndex(float zIndex) Sets the z-index of a polygon. |
Method |
|---|
public PolygonOptions add(LatLng... points) Sets multiple vertices of a polygon. |
Parameters
Name | Description |
|---|---|
points | Coordinates of multiple vertices. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object containing the specified vertices. |
Method |
|---|
public PolygonOptions add(LatLng point) Adds a vertex to a polygon. |
Parameters
Name | Description |
|---|---|
point | Coordinates of a vertex. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object containing the specified vertex. |
Method |
|---|
public PolygonOptions addAll(Iterable<LatLng> points) Adds multiple vertices to a polygon. |
Parameters
Name | Description |
|---|---|
points | Multiple vertices. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object containing the specified vertices. |
Method |
|---|
public PolygonOptions addHole(Iterable<LatLng> points) Adds multiple holes to a polygon. |
Parameters
Name | Description |
|---|---|
points | Multiple holes. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object containing multiple specified holes. |
Method |
|---|
public PolygonOptions clickable(boolean clickable) Sets whether a polygon is tappable. |
Parameters
Name | Description |
|---|---|
clickable | Indicates whether a polygon is tappable.
The default value is false. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new tappability setting. |
Method |
|---|
public PolygonOptions fillColor(int color) Sets the fill color of a polygon. |
Parameters
Name | Description |
|---|---|
color | Color in ARGB format. By default, the fill color is transparent (0x00000000). |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new fill color. |
Method |
|---|
public PolygonOptions geodesic(boolean geodesic) Sets whether to draw each segment of a polygon as a geodesic. |
Parameters
Name | Description |
|---|---|
geodesic | Indicates whether to draw each segment of a polygon as a geodesic.
The default value is false. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new geodesic attribute setting. |
Method |
|---|
public List<List<LatLng>> getHoles() Obtains holes in a polygon on a map. |
Returns
Type | Description |
|---|---|
List<List<LatLng>> | Holes in a polygon. |
Method |
|---|
public List<LatLng> getPoints() Obtains all vertices of a polygon. |
Returns
Type | Description |
|---|---|
List<LatLng> | All vertices of a polygon. |
Method |
|---|
public List<PatternItem> getStrokePattern() Obtains the stroke pattern of a polygon's outline. |
Returns
Type | Description |
|---|---|
List<PatternItem> | Stroke pattern of a polygon's outline. |
Method |
|---|
public PolygonOptions strokeColor(int color) Sets the stroke color of a polygon's outline. |
Parameters
Name | Description |
|---|---|
color | Color in ARGB format. By default, the stroke color is black (0xff000000). |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new outline stroke color. |
Method |
|---|
public PolygonOptions strokeJointType(int jointType) Sets the joint type of a polygon. |
Parameters
Name | Description |
|---|---|
jointType | Joint type. The default value is DEFAULT. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new joint type. |
Method |
|---|
public PolygonOptions strokePattern(List<PatternItem> pattern) Sets the stroke pattern of a polygon's outline. |
Parameters
Name | Description |
|---|---|
pattern | PatternItem object set. The default value is null, indicating that the stroke is in the solid pattern. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new outline pattern. |
Method |
|---|
public PolygonOptions strokeWidth(float width) Sets the stroke width of a polygon's outline. |
Parameters
Name | Description |
|---|---|
width | Stroke width of a polygon's outline, in pixels. The default value is 10. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new outline stroke width. |
Method |
|---|
public PolygonOptions visible(boolean visible) Sets whether a polygon is visible. If the polygon is invisible, it will not be drawn but all other states will be preserved. |
Parameters
Name | Description |
|---|---|
visible | Indicates whether a polygon is visible. By default, a polygon is visible. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new visibility setting. |
Method |
|---|
public PolygonOptions zIndex(float zIndex) Sets the z-index of a polygon. The z-index indicates the overlapping order of a polygon. A polygon with a larger z-index overlaps that with a smaller z-index. Polygons with the same z-index overlap each other by the order in which they are added. |
Parameters
Name | Description |
|---|---|
zIndex | Z-index, which indicates the overlapping order of a polygon. By default, the z-index is 0. |
Returns
Type | Description |
|---|---|
PolygonOptions | PolygonOptions object with the new z-index. |