I want to create a circle overlay over the annotation. I'm using swift 3.0. Any help is appreciated !!
Asked
Active
Viewed 297 times
1 Answers
1
Try a custom overlay. Add this in viewDidLoad
:
MKCircle *circle = [MKCircle circleWithCenterCoordinate:userLocation.coordinate radius:1000];
[map addOverlay:circle];
userLocation
can be obtained by storing the MKUserLocationAnnotation
as a property. Then, to actually draw the circle, put this in the map view's delegate:
- (MKOverlayRenderer *)mapView:(MKMapView *)map viewForOverlay:(id <MKOverlay>)overlay
{
MKCircleRenderer *circleView = [[MKCircleRenderer alloc] initWithOverlay:overlay];
circleView.strokeColor = [UIColor redColor];
circleView.fillColor = [[UIColor redColor] colorWithAlphaComponent:0.4];
return circleView;
}

Matusalem Marques
- 2,399
- 2
- 18
- 28

Pulkit Aggarwal
- 2,554
- 4
- 23
- 33