自定义叠加(圆形)
我试图显示一个圆形的叠加层 在 5000 x 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;
}
,但是当我运行此代码时,仅加载地图,错误是什么?
i was trying to show an overlay with circle shape
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??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论