自定义叠加层(圆圈)

时间:2010-11-30 12:48:14

标签: android iphone overlay android-mapview

我试图展示圆形的叠加层 在5000乘5000的区域 我在viewDidLoad

中按以下方式定义了圆圈
MKCircle* circle = [MKCircle circleWithCenterCoordinate:coordinate radius:500];
[mapView addOverlay:circle];

并且对于叠加视图,我提供了以下代码

-(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;
}

但是当我运行它时,只有地图被加载,错误是什么?

0 个答案:

没有答案
相关问题