1

所以就像标题所说,我想知道如何实现覆盖边缘的黑色手柄/按钮

我想同谋

当前用于创建叠加层和注释的代码 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)
}

它看起来如何

我目前的结果

4

1 回答 1

0

我刚刚基于 ResizableMKCircleOverlay 创建了这个 Pod。

我必须继承 MKMapView 以获得良好的抽象层。如果您已经拥有一个功能简单的 MapViewController,那么它实际上很容易与您当前的 MapViewController 集成。

这里。

于 2018-03-22T15:24:01.507 回答