Mapkit drawing a circle

1.4k views Asked by At

I would like to do the following using the MapKit in iOS.

I want to place a position on a map and draw a circle around it where the diameter of the circle represents a range. This circle should have a solid color with an alpha of 25%. Much like the circle you get around your own position using google maps when the position is not accurate enough. Deciding how large the circle should be could either be using an extra view or using pinching.

How can I do this?

1

There are 1 answers

3
Aurum Aquila On BEST ANSWER

For the drawing part, couldn't you just draw a square then round it's corners?

#import <Quartz/QuartzCore.h>

-(void)viewDidLoad{
    mapRect.cornerRadius = mapRect.frame.size.height/2;//Corner radius = height/2
}

Something like that should get you half way there. I don't know how you're doing the collision detection though.