我正在抛光我的应用并希望避免注释的闪烁。有什么方法可以解决这个问题吗?
目前我在创建新注释后立即删除旧注释
DispatchQueue.main.async {
let annotation = MKPointAnnotation()
annotation.coordinate = locations.last!.coordinate
annotation.title = "Speed"
let speed = locations.last!.speed * 3.6 // converting to km/h
annotation.subtitle = String(format: "%.2f km/h", speed)
self.mapView.addAnnotation(annotation)
if let oldAnnotation = self.drawer.oldAnnotation {
self.mapView.removeAnnotation(oldAnnotation)
}
self.mapView.selectAnnotation(annotation, animated: false)
self.drawer.oldAnnotation = annotation
}