作者:壹起等绿灯 | 来源:互联网 | 2023-05-18 23:49
Icreatenewoverlayslikethis:我创建这样的新覆盖:MKCircle*circle[MKCirclecircleWithCenterCoordinate
I create new overlays like this:
我创建这样的新覆盖:
MKCircle *circle = [MKCircle circleWithCenterCoordinate:region.coordinate radius:region.radius];
[self.mapView addOverlay:circle];
also I implemented delegate method:
我还实现了委托方法:
- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id)overlay {
MKCircleRenderer *circleRenderer = [[MKCircleRenderer alloc] init];
circleRenderer.fillColor = [UIColor greenColor];
circleRenderer.alpha = 1.f;
return circleRenderer;
}
both parts of code are called, mapView != nil at that moment, it's delegate set, but I cannot see the circle on my map.
代码的两个部分都被调用,mapView != nil,它是委托集,但是我看不到地图上的圆。
What am I doing wrong?
我做错了什么?
2 个解决方案