我遇到一个错误:
无法使用类型为“(中心:CLLocationCoordinate2D,半径:int,标识符:字符串)”的参数列表调用类型“MKCircle”的初始化程序
let region = CLCircularRegion(coder: MKCircle(center: CLLocationCoordinate2DMake(self.destLat!, self.destLong!), radius: 100, identifier: destinationAddress))
self.locationManager .startMonitoring(for: region)
下面是我的叠加方法
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
if overlay is MKCircle {
let circleRenderer = MKCircleRenderer(overlay: overlay)
circleRenderer.lineWidth = 1.0
circleRenderer.strokeColor = .purple
circleRenderer.fillColor = UIColor.purple.withAlphaComponent(0.4)
return circleRenderer
}
let myLineRenderer = MKPolylineRenderer(polyline: myRoute.polyline)
myLineRenderer.strokeColor = UIColor.blue
myLineRenderer.lineWidth = 3
return myLineRenderer
}