gpt4 book ai didi

swift - 如何使用叠加层边缘的句柄调整 mapOverlay 的大小?

转载 作者:行者123 更新时间:2023-11-28 08:04:51 24 4
gpt4 key购买 nike

正如标题所说,我想知道如何实现叠加层边缘的黑色 handle /按钮

what I want to accomplice

代码 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)
}

外观

my current result

最佳答案

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

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

Here.

关于swift - 如何使用叠加层边缘的句柄调整 mapOverlay 的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45486944/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com