iOS Developer Library

Developer

MapKit Framework Reference MKCircle Class Reference

Options
Deployment Target:

On This Page
Language:

MKCircle

Inherits From


Conforms To


Import Statement


Swift

import MapKit

Objective-C

@import MapKit;

Availability


Available in iOS 4.0 and later

The MKCircle class is a concrete overlay object representing a circular area on a map. This class manages the data that defines the area and is typically used in conjunction with an MKCircleView object, which handles the drawing of the circular area on a map.

  • Creates and returns an MKCircle object using the specified coordinate and radius.

    Declaration

    Swift

    convenience init!(centerCoordinate coord: CLLocationCoordinate2D, radius radius: CLLocationDistance)

    Objective-C

    + (instancetype)circleWithCenterCoordinate:(CLLocationCoordinate2D)coord radius:(CLLocationDistance)radius

    Parameters

    coord

    The center point of the circle, specified as a latitude and longitude value.

    radius

    The radius of the circle, measured in meters from the center point.

    Return Value

    A circle overlay object.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 4.0 and later

  • Creates and returns an MKCircle object where the circular area is derived from the specified rectangle.

    Declaration

    Swift

    convenience init!(mapRect mapRect: MKMapRect)

    Objective-C

    + (instancetype)circleWithMapRect:(MKMapRect)mapRect

    Parameters

    mapRect

    The map rectangle used to determine the circular area. The center point of the rectangle is used as the center point of the circle. If the rectangle is not a square, the longest side of the rectangle is used to define the radius of the resulting circle.

    Return Value

    A circle overlay object.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 4.0 and later

  • The center point of the circular area, specified as a latitude and longitude. (read-only)

    Declaration

    Swift

    var coordinate: CLLocationCoordinate2D { get }

    Objective-C

    @property(nonatomic, readonly) CLLocationCoordinate2D coordinate

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 4.0 and later

  • radius radius Property

    The radius of the circular area, measured in meters. (read-only)

    Declaration

    Swift

    var radius: CLLocationDistance { get }

    Objective-C

    @property(nonatomic, readonly) CLLocationDistance radius

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 4.0 and later

  • The bounding rectangle of the circular area. (read-only)

    Declaration

    Swift

    var boundingMapRect: MKMapRect { get }

    Objective-C

    @property(nonatomic, readonly) MKMapRect boundingMapRect

    Discussion

    As latitude values move away from the equator and toward the poles, the physical distance between map points gets smaller. This means that more map points are needed to represent the same distance. As a result, the bounding rectangle of a circle overlay gets larger as the center point of that circle moves away from the equator and toward the poles.

    Import Statement

    Objective-C

    @import MapKit;

    Swift

    import MapKit

    Availability

    Available in iOS 4.0 and later