MKCircle Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/MapKit.framework
Availability
Available in iOS 4.0 and later.
Companion guide
Declared in
MKCircle.h
Related sample code

Overview

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.

Tasks

Creating a Circle Overlay

Accessing the Overlay’s Attributes

Properties

boundingMapRect

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

@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.

Availability
  • Available in iOS 4.0 and later.
Declared In
MKCircle.h

coordinate

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

@property (nonatomic, readonly) CLLocationCoordinate2D coordinate
Availability
  • Available in iOS 4.0 and later.
Related Sample Code
Declared In
MKCircle.h

radius

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

@property (nonatomic, readonly) CLLocationDistance radius
Availability
  • Available in iOS 4.0 and later.
Declared In
MKCircle.h

Class Methods

circleWithCenterCoordinate:radius:

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

+ (MKCircle *)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.

Availability
  • Available in iOS 4.0 and later.
Related Sample Code
Declared In
MKCircle.h

circleWithMapRect:

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

+ (MKCircle *)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.

Availability
  • Available in iOS 4.0 and later.
Declared In
MKCircle.h