2017-02-18 5 views

答えて

1

カスタムオーバーレイをお試しください。 viewDidLoadでこれを追加します。

MKCircle *circle = [MKCircle circleWithCenterCoordinate:userLocation.coordinate radius:1000]; 
[map addOverlay:circle]; 

userLocationはプロパティとしてMKUserLocationAnnotationを格納することによって得ることができます。次に、実際にサークルを描画するには、マップビューのデリゲートにこれを配置します。

- (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; 
} 
関連する問題