java.lang.Object | |||
↳ | com.neomades.maps.overlay.BaseOverlay | ||
↳ | com.neomades.maps.overlay.Overlay | ||
↳ | com.neomades.maps.overlay.Circle |
A circle on the earth's surface (spherical cap).
A circle has the following properties.
The center of the Circle is specified as a Location.
The radius of the circle, specified in meters. It should be zero or greater.
The width of the circle's outline in screen pixels. The width is constant and independent of the camera's zoom level. The default value is 10.
The color of the circle outline in ARGB format, the same format used by Color. The default value is black (0xff000000).
The color of the circle fill in ARGB format, the same format used by Color. The default value is transparent (0x00000000).
The order in which this tile overlay is drawn with respect to other overlays. An overlay with a larger z-index is drawn over overlays with smaller z-indices. The order of overlays with the same z-index is arbitrary. The default z-index is 0.
Indicates if the circle is visible or invisible, i.e., whether it is drawn on the map. An invisible circle is not drawn, but retains all of its other properties. The default is true, i.e., visible.
Methods that modify a Circle must be called on the main thread. If not, an IllegalStateException will be thrown at runtime.
ExampleMap map; // ... get a map. // Add a circle in Sydney Circle circle = new Circle() .setCenter(new Location(-33.87365, 151.20689)) .setRadius(10000) .setStrokeColor(Color.RED) .setFillColor(Color.BLUE)); map.add(circle);Note that the current map renderer is unable to draw the circle fill if the circle encompasses either the North or South pole. However, the outline will still be drawn correctly.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Circle()
Creates a new Circle.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Location |
getCenter()
Returns the center as a Location.
| ||||||||||
Color |
getFillColor()
Returns the fill color.
| ||||||||||
double |
getRadius()
Returns the circle's radius, in meters.
| ||||||||||
Color |
getStrokeColor()
Returns the stroke color.
| ||||||||||
int |
getStrokeWidth()
Returns the stroke width.
| ||||||||||
int |
getZIndex()
Returns the z-index.
| ||||||||||
boolean |
isVisible()
Checks whether the circle is visible.
| ||||||||||
Circle |
setCenter(Location center)
Sets the center using a Location.
| ||||||||||
Circle |
setFillColor(Color color)
Sets the fill color.
| ||||||||||
Circle |
setRadius(double radius)
Sets the radius in meters.
| ||||||||||
Circle |
setStrokeColor(Color color)
Sets the stroke color.
| ||||||||||
Circle |
setStrokeWidth(int width)
Sets the stroke width.
| ||||||||||
Circle |
setVisible(boolean visible)
Sets the visibility.
| ||||||||||
Circle |
setZIndex(int zIndex)
Sets the z-index.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Creates a new Circle.
Returns the center as a Location.
Returns the circle's radius, in meters.
Returns the stroke width.
Returns the z-index.
Checks whether the circle is visible.
Sets the center using a Location.
The center must not be null. This method is mandatory because there is no default center.
center | The geographic center as a Location. |
---|
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. By default the fill color is transparent (0x00000000).
color | Fill color |
---|
Sets the radius in meters.
The radius must be zero or greater. The default radius is zero.
radius | radius in meters |
---|
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. By default the stroke color is black (0xff000000).
color | stroke color |
---|
Sets the stroke width.
The stroke width is the width (in screen DP) of the circle's outline. It must be zero or greater. If it is zero then no outline is drawn. The default width is 10dp.
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 z-index.
Overlays (such as circles) with higher z-indices are drawn above those with lower indices. By default the z-index is 0.
zIndex | z-index value |
---|