CCHMapClusterController
CCHMapClusterController copied to clipboard
Getting wrong annotation count on click of cluster in swift 3
When I click on a particular cluster then not getting a exact annotation count that I showed over label In swift 3.I am showing this label over image in swift 3. Can anybody help me
Hey! It's hard to tell exactly what you're seeing based on this brief bug report, but: I was seeing a similar issue for a bit in my code, and found a fix for my issue. I needed to implement mapClusterController(_:willReuse:) — and in my implementation, I need to re-set the counter label I had on my little badge view.
Hope that helps!
public func mapClusterController(_ mapClusterController: CCHMapClusterController!, willReuse mapClusterAnnotation: CCHMapClusterAnnotation!) {
let annotationView = mapView.view(for: mapClusterAnnotation) as! PhotoClusterAnnotationView
self.update(annotationView: annotationView, withAnnotation: mapClusterAnnotation)
annotationView.prepareForReuse()
}