I\'m trying to draw some circle overlays containing text on MKMapView. I have subclassed the MKCircleView, in which I put the following (based on this), but the text does no
Combining the answers here and updating for IOS7:
-(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
{
[super drawMapRect:mapRect zoomScale:zoomScale inContext:context];
UIGraphicsPushContext(context);
CGContextSaveGState(context);
[[UIColor blueColor] set];
NSDictionary *fontAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:10.0f * MKRoadWidthAtZoomScale(zoomScale)]};
CGSize size = [[[self overlay] title] sizeWithAttributes:fontAttributes];
CGFloat height = ceilf(size.height);
CGFloat width = ceilf(size.width);
CGRect circleRect = [self rectForMapRect:[self.overlay boundingMapRect]];
CGPoint center = CGPointMake(circleRect.origin.x + circleRect.size.width /2, circleRect.origin.y + circleRect.size.height /2);
CGPoint textstart = CGPointMake(center.x - width/2, center.y - height /2 );
[[[self overlay] title] drawAtPoint:textstart withAttributes:fontAttributes];
CGContextRestoreGState(context);
UIGraphicsPopContext();
}