Mapkit drawing a circle
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?
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.
精彩评论