所以就像标题所说,我想知道如何实现覆盖边缘的黑色手柄/按钮
当前用于创建叠加层和注释的代码 I 用户
func makeAnnotation(locationCoordinate: CLLocationCoordinate2D){
let overlay = MKCircle(center: locationCoordinate, radius: 100)
let allOverlays = self.mapView.overlays
let annotation = MKPointAnnotation()
let allAnnotations = self.mapView.annotations
if self.mapView.annotations.isEmpty == false {
self.mapView.removeAnnotations(allAnnotations)
self.mapView.removeOverlays(allOverlays)
}
//Make coordinats into adress
let location = CLLocation(latitude: locationCoordinate.latitude, longitude: locationCoordinate.longitude)
CLGeocoder().reverseGeocodeLocation(location, completionHandler: {(placemarks, error) -> Void in
if error != nil {
print(error as Any)
}
let placemark = placemarks?[0]
guard let street = placemark?.thoroughfare else {
return annotation.title = ""
}
guard let addressNumber = placemark?.subThoroughfare else {
return annotation.title = street
}
self.fullAdress = street + " " + addressNumber
annotation.title = self.fullAdress
})
annotation.coordinate = locationCoordinate
mapView.add(overlay)
mapView.addAnnotation(annotation)
}
它看起来如何