ResizableMKCircleOverlay 0.1.0

ResizableMKCircleOverlay 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License Custom
ReleasedLast Release Dec 2014

Maintained by Michael Bawiec.




  • By
  • OrbJapan

A resizable map circle overlay.

Objective:

Have a resizable circle overlay, without recreating an MKCircle object.

How to use:

CustomMapOverlay is a subclass of MKCircleView. In your map controller override 'viewForOverlay with the custom class.

- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id < MKOverlay >)overlay{
    circleView = [[CustomMKCircleOverlay alloc] initWithCircle:overlay];
    circleView.fillColor = [UIColor redColor];

    return circleView;
}
Initilize

-(id)initWithCircle:(MKCircle *) circle withRadius:(double)radius withMin:(int) min withMax:(int) max;
-(id)initWithCircle:(MKCircle *) circle withRadius:(double)radius;
-(id)initWithCircle:(MKCircle *) circle;

-radius is always in meters
-min/max will set a min and max size for the circle (also meters).

UpdateCircle

-(void)setCircleRadius:radius; - set the circle radius.
-(void)setFillColor:UIColor; - set the circle Color.

@property(nonatomic) CGFloat alpha; //Default = .3
@property(nonatomic) CGFloat border; //Default = 15

This class alone does not handle Gestures so you will need to implement that on your own or take a look at the example project. The example project uses 'WildcardGestureRecognizer' to detect if the overlay was touched.