public final class Circle
Defines a circle on a map. There are two types of circles: solid circle and hollow circle.
None.
None.
| Return type | Method name |
| LatLng | getCenter() |
| int | getFillColor() |
| String | getId() |
| double | getRadius() |
| int | getStrokeColor() |
| float | getStrokeWidth() |
| Object | getTag() |
| float | getZIndex() |
| List<PatternItem> | getStrokePattern() |
| boolean | isClickable() |
| boolean | isVisible() |
| void | remove() |
| void | setCenter(LatLng center) |
| void | setClickable(boolean clickable) |
| void | setFillColor(int color) |
| void | setRadius(double radius) |
| void | setStrokeColor(int color) |
| void | setStrokePattern(@Nullable List<PatternItem> pattern) |
| void | setStrokeWidth(float width) |
| <T> void | setTag(@Nullable T tag) |
| void | setVisible(boolean visible) |
| void | setZIndex(float zIndex) |
| Method |
| public LatLng getCenter() |
| Obtains the latitude and longitude of the center of a circle. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| LatLng | Longitude and latitude of the center of a circle. |
| Method |
| public int getFillColor() |
| Obtains the fill color of a circle. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| int | Color in ARGB format. |
| Method |
| public String getId() |
| Obtains the ID of a circle on a map. The ID will be unique among all circles on a map. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| String | ID of a circle. |
| Method |
| public double getRadius() |
| Obtains the radius of a circle. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| double | Radius of a circle, in meters. |
| Method |
| public int getStrokeColor() |
| Obtains the stroke color of a circle's outline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| int | Color in ARGB format. |
| Method |
| public float getStrokeWidth() |
| Obtains the stroke width of a circle's outline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| float | Stroke width of a circle's outline, in pixels. |
| Method |
| public Object getTag() |
| Obtains the tag that has been set for a circle. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| Object | Tag of a circle. If no tag has been set, null is returned. |
| Method |
| public float getZIndex() |
| Obtains the z-index of a circle. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| float | Z-index, which indicates the overlapping order of a circle. |
| Method |
| public List<PatternItem> getStrokePattern() |
| Obtains the stroke pattern of a circle's outline. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| List<PatternItem> | Stroke pattern of a circle's outline. |
| Method |
| public boolean isClickable() |
| Checks whether a circle is tappable. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| boolean | If a circle is tappable, true is returned. Otherwise, false is returned. |
| Method |
| public boolean isVisible() |
| Checks whether a circle is visible. |
Parameters:
None.
Return:
| Return type | Parameter desc |
| boolean | If a circle is visible, true is returned. Otherwise, false is returned. |
| Method |
| public void remove() |
| Removes a circle from a map. After the circle is removed, the behavior of its methods is invalid. |
Parameters:
None.
Return:
None.
| Method |
| public void setCenter(LatLng center) |
| Sets the longitude and latitude of the center of a circle. The center cannot be null because there is no default value. |
Parameters:
| Parameter name | Parameter desc |
| center | Center of a circle. |
Return:
None.
Exception:
| Exception type | Scenario |
| NullPointerException | The center is null. |
| Method |
| public void setClickable(boolean clickable) |
| Specifies whether a circle is tappable. |
Parameters:
| Parameter name | Parameter desc |
| clickable | Indicates whether a circle is tappable. |
Return:
None.
| Method |
| public void setFillColor(int color) |
| Sets the fill color of a circle. If it is set as transparent, the circle will not be filled. |
Parameters:
| Parameter name | Parameter desc |
| color | Color in ARGB format. By default, the fill color is transparent (0x00000000). |
Return:
None.
| Method |
| public void setRadius(double radius) |
| Sets the radius of a circle. |
Parameters:
| Parameter name | Parameter desc |
| radius | Radius of a circle, in meters. The value must be greater than or equal to 0. |
Return:
None.
| Method |
| public void setStrokeColor(int color) |
| Sets the stroke color of a circle's outline. If it is set as transparent, no outline will be drawn for the circle. |
Parameters:
| Parameter name | Parameter desc |
| color | Color in ARGB format. By default, the stroke color is black (0xff000000). |
Return:
None.
| Method |
| public void setStrokePattern(@Nullable List<PatternItem> pattern) |
| Sets the stroke pattern of a circle's outline. By default, the stroke pattern is solid, represented by null. |
Parameters:
| Parameter name | Parameter desc |
| pattern | PatternItem object set. |
Return:
None.
| Method |
| public void setStrokeWidth(float width) |
| Sets the stroke width of a circle's outline. |
Parameters:
| Parameter name | Parameter desc |
| width | Stroke width in pixels. The value must be greater than or equal to 0. |
Return:
None.
Exception:
| Exception type | Scenario |
| IllegalArgumentException | The stroke width is negative. |
| Method |
| public <T> void setTag(@Nullable T tag) |
| Sets the tag of a circle. If null is passed, the existing tag is cleared. |
Parameters:
| Parameter name | Parameter desc |
| tag | Tag of a circle. |
Return:
None.
Parameters:
| Parameter name | Parameter desc |
| visible | Visibility of a circle. |
Return:
None.
Parameters:
| Parameter name | Parameter desc |
| zIndex | Z-index, which indicates the overlapping order of a circle. |
Return:
None.