I need the same filled space around circle on the map as in Reminders app in iOS7. I think need to use the method applyFillPropertiesToContext:atZoomScale
or fillPath:inContext:
.
Asked
Active
Viewed 1,661 times
3

buh
- 440
- 2
- 12
-
Post what you have tried and point out what issue you are having. – rmaddy Nov 14 '13 at 18:08
1 Answers
8
I solved my problem:
- (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
{
// Fill full map rect with some color.
CGRect rect = [self rectForMapRect:mapRect];
CGContextSaveGState(context);
CGContextAddRect(context, rect);
CGContextSetFillColorWithColor(context, [UIColor colorWithWhite:0.0 alpha:0.4f].CGColor);
CGContextFillRect(context, rect);
CGContextRestoreGState(context);
// Clip rounded hole.
CGContextSaveGState(context);
CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextSetBlendMode(context, kCGBlendModeClear);
CGContextFillEllipseInRect(context, [self rectForMapRect:[self.overlay boundingMapRect]]);
CGContextRestoreGState(context);
// Draw circle
[super drawMapRect:mapRect zoomScale:zoomScale inContext:context];
}

buh
- 440
- 2
- 12
-
I used the above code but in my case , the circle isn't drawn, only the black semi transparrent overlay is shown. Can you please help me to have same output as you – HarshIT Feb 05 '15 at 08:41