public final class Circle extends Object
A circle has the following properties.
Center
The center of the Circle is specified as a GridPoint
.
Radius
The radius of the circle, specified in meters. It should be zero or greater.
Stroke Width
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.
Stroke Color
The color of the circle outline in ARGB format, the same format used by android.graphics.Color. The default value is black (0xff000000).
Fill Color
The color of the circle fill in ARGB format, the same format used by android.graphics.Color. The default value is transparent (0x00000000).
Visibility
Indicates if the circle is visible or invisible, i.e., whether it is drawn on the map. An invisible polygon is not drawn, but retains all of its
other properties. The default is true, i.e., visible.
Methods that modify a Polygon must be called on the main thread. If not, an IllegalStateException may be thrown at runtime.
Modifier and Type | Method and Description |
---|---|
GridPoint |
getCenter()
Returns the center as a
GridPoint |
int |
getFillColor()
Returns the fill color of this Shape.
|
double |
getRadius()
Returns the circle's radius, in meters.
|
int |
getStrokeColor()
Returns the stroke color.
|
float |
getStrokeWidth()
Returns the stroke width.
|
float |
getZIndex()
Returns the zIndex.
|
boolean |
isVisible()
Checks whether the shape is visible.
|
void |
remove()
Removes this shape from the map.
|
void |
setCenter(GridPoint center)
Sets the center using a
GridPoint . |
void |
setFillColor(int fillColor)
Sets the fill color.
|
void |
setRadius(double radius)
Sets the radius in meters.
|
void |
setStrokeColor(int color)
Sets the stroke color.
|
void |
setStrokeWidth(float width)
Sets the stroke width.
|
void |
setVisible(boolean visible)
Sets the visibility of the shape.
|
void |
setZIndex(float zIndex)
Sets the zIndex.
|
public GridPoint getCenter()
GridPoint
GridPoint
.public void setCenter(GridPoint center)
GridPoint
.
The center must not be null, as there is no default value.
center
- The geographic center of the circle, specified as a GridPoint
.public double getRadius()
public void setRadius(double radius)
The radius must be zero or greater.
radius
- The radius, in meters.public void setZIndex(float zIndex)
zIndex
- public void setVisible(boolean visible)
visible
- false to make this shape invisible.public float getZIndex()
public boolean isVisible()
public void setStrokeColor(int color)
The stroke color is the color of this shape's outline, in the integer format specified by android.graphics.Color. If TRANSPARENT is used then no outline is drawn.
color
- The stroke color in the android.graphics.Color format.public void setStrokeWidth(float width)
The stroke width is the width (in screen pixels) of the shape's outline. It must be zero or greater. If it is zero then no outline is drawn. The default value is 10.
Behaviour with a negative width is undefined.
width
- The stroke width, in screen pixels.public int getStrokeColor()
public float getStrokeWidth()
public int getFillColor()
public void setFillColor(int fillColor)
The fill color is the color inside the shape, in the integer format specified by android.graphics.Color. If TRANSPARENT is used then no fill is drawn.
fillColor
- The color in the android.graphics.Color format.public final void remove()
Copyright © 2012–2013 Ordnance Survey. All rights reserved.