Swift 如何使用叠加边缘上的控制柄调整mapOverlay的大小?
正如标题所说,我想知道如何实现覆盖边缘的黑色手柄/按钮 当前用于创建覆盖和注释的代码I用户Swift 如何使用叠加边缘上的控制柄调整mapOverlay的大小?,swift,mapkit,overlay,mkcircle,Swift,Mapkit,Overlay,Mkcircle,正如标题所说,我想知道如何实现覆盖边缘的黑色手柄/按钮 当前用于创建覆盖和注释的代码I用户 func makeAnnotation(locationCoordinate: CLLocationCoordinate2D){ let overlay = MKCircle(center: locationCoordinate, radius: 100) let allOverlays = self.mapView.overlays let annotation = MKPoi
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)
}
它看起来怎么样
我刚刚基于ResizebleKcircleOverlay创建了这个Pod 我必须对MKMapView进行子类化,以获得良好的抽象层。如果您已经有了一个功能简单的MapViewController,那么它实际上很容易与当前的MapViewController集成
我刚刚基于ResizebleKcircleOverlay创建了这个Pod 我必须对MKMapView进行子类化,以获得良好的抽象层。如果您已经有了一个功能简单的MapViewController,那么它实际上很容易与当前的MapViewController集成
退房。谢谢,但那是在objective-C中。不幸的是,您可以使用Swift的objective-C框架。好的,我试试!谢谢,但这是在objective-C中不幸的是,你可以使用Swift的objective-C框架。好的,我试试!