java.lang.Object | |
↳ | com.google.android.gms.maps.model.Circle |
A circle on the earth's surface (spherical cap).
A circle has the following properties.
LatLng
.
Color
.Color
.true
, i.e., visible.Methods that modify a Polygon must be called on the main thread. If not, an
IllegalStateException
will be thrown at runtime.
GoogleMap map;
// ... get a map.
// Add a circle in Sydney
Circle circle = map.addCircle(new CircleOptions()
.center(new LatLng(-33.87365, 151.20689)
.radius(10000)
.strokeColor(Color.RED)
.fillColor(Color.BLUE));
Note that the current map renderer is unable to draw the circle fill if the circle encompasses either North and/or South pole. However the outline will still be drawn correctly.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the center as a
LatLng . | |||||||||||
Gets the fill color.
| |||||||||||
Gets the id.
| |||||||||||
Gets the radius in meters.
| |||||||||||
Gets the stroke color.
| |||||||||||
Gets the stroke width.
| |||||||||||
Gets the zIndex.
| |||||||||||
Gets the visibility of this circle.
| |||||||||||
Removes from the map.
| |||||||||||
Sets the center using a
LatLng . | |||||||||||
Sets the fill color.
| |||||||||||
Sets the radius in meters.
| |||||||||||
Sets the stroke color.
| |||||||||||
Sets the stroke width.
| |||||||||||
Sets the visibility.
| |||||||||||
Sets the zIndex.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Gets the radius in meters.
Gets the stroke width.
Gets the zIndex.
Gets the visibility of this circle.
Removes from the map.
Sets the center using a LatLng
.
The center must not be null.
center | geographic center as a LatLng |
---|
NullPointerException | if center is null |
---|
Sets the fill color.
The fill color is the color inside the circle, in the integer
format specified by Color
.
If TRANSPARENT
is used then no fill is
drawn.
color | color in the Color format
|
---|
Sets the radius in meters.
The radius must be zero or greater.
radius | radius in meters |
---|
IllegalArgumentException | if radius is negative |
---|
Sets the stroke color.
The stroke color is the color of this circle's outline, in the integer
format specified by Color
.
If TRANSPARENT
is used then no outline is
drawn.
color | color in the Color format
|
---|
Sets the stroke width.
The stroke width is the width (in screen pixels) of the circle's outline. It must be zero or greater. If it is zero then no outline is drawn.
width | width in screen pixels |
---|
IllegalArgumentException | if width is negative |
---|
Sets the visibility.
If this circle is not visible then it is not drawn, but all other state is preserved.
visible | false to make this circle invisible |
---|
Sets the zIndex.
Overlays (such as circles) with higher zIndices are drawn above those with lower indices.
zIndex | zIndex value |
---|