custom overlay (circle)
i was trying to show an overlay with circle s开发者_运维百科hape in a region of 5000 by 5000 i defined the circle in the following way in viewDidLoad
MKCircle* circle = [MKCircle circleWithCenterCoordinate:coordinate radius:500];
[mapView addOverlay:circle];
and for the overlay view i gave the following code
-(MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id)overlay {
MKCircleView* circleView = [[[MKCircleView alloc] initWithOverlay:overlay] autorelease];
circleView.strokeColor = [UIColor redColor];
circleView.lineWidth = 2.0;
//Uncomment below to fill in the circle
circleView.fillColor = [UIColor redColor];
return circleView;
}
but when i run this,only the map gets loaded,what is the error??
精彩评论