Page Summary
-
GMSCirclerepresents a circle on the Earth's surface, defined by its center position and radius. -
It offers properties to customize the appearance, including stroke width, color, and fill color.
-
By default, the circle has a black outline with a width of 1 screen point and no fill.
-
You can create a
GMSCircleinstance using the convenience constructor, providing the position and radius. -
Stroke width of 0 results in no stroke, and a nil fill color results in no fill.
GMSCircle
@interface
GMSCircle
:
GMSOverlay
A circle on the Earth’s surface (spherical cap).
-
Position on Earth of circle center. Ignores invalid positions.
Declaration
Swift
var position : CLLocationCoordinate2D { get set }Objective-C
@property ( nonatomic ) CLLocationCoordinate2D position ; -
Radius of the circle in meters; must be positive.
Declaration
Swift
var radius : CLLocationDistance { get set }Objective-C
@property ( nonatomic ) CLLocationDistance radius ; -
The width of the circle’s outline in screen points. Defaults to 1. As per
GMSPolygon, the width does not scale when the map is zoomed.Setting strokeWidth to 0 results in no stroke.
Declaration
Swift
var strokeWidth : CGFloat { get set }Objective-C
@property ( nonatomic ) CGFloat strokeWidth ; -
The color of this circle’s outline. The default value is black.
Declaration
Swift
var strokeColor : UIColor ? { get set }Objective-C
@property ( nonatomic , nullable ) UIColor * strokeColor ; -
The interior of the circle is painted with fillColor. The default value is nil, resulting in no fill.
Declaration
Swift
var fillColor : UIColor ? { get set }Objective-C
@property ( nonatomic , nullable ) UIColor * fillColor ; -
Convenience constructor for
GMSCirclefor a particular position and radius. Other properties will have default values. An invalid position will result in an overlay object that cannot be drawn on the map.Declaration
Swift
convenience init ( position : CLLocationCoordinate2D , radius : CLLocationDistance )Objective-C
+ ( nonnull instancetype ) circleWithPosition :( CLLocationCoordinate2D ) position radius :( CLLocationDistance ) radius ;

