hulab / ClusterKit

An iOS map clustering framework targeting MapKit, Google Maps and Mapbox.
MIT License
515 stars 86 forks source link

Collapsing animation customisation feature #34

Open mrfonda opened 7 years ago

mrfonda commented 7 years ago

Hello! I'm trying to add some additional alpha animation to collapsing annotationViews animation, but it seems CKClusterManagerDelegate doesn't provide proper methods to do this. By using 'clusterManager performAnimations' delegate method I can only manipulate animation code blocks but not the annotations that are going to animate. I found a workaround for expanding animation simply by animate alpha separately in mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]): func mapView(_ mapView: MKMapView, didAdd views: [MKAnnotationView]) { views.forEach { (annotation) in annotation.alpha = 0.01 UIView.animate(withDuration: 0.5, animations: { annotation.alpha = 1.0 }) } } But I can't found a workaround for fade out animation on collapsing. I need this because I have different shapes of annotationViews and the collapse animation because of that, looks a little bit weird. Please, add the ability to customise animations.

ghost commented 6 years ago

Would love to see this as well. Specifically alpha or scale animations in place of expand/contract coordinate locations.

aramsargsyan commented 5 years ago

@mrfonda @l2comdev See https://github.com/hulab/ClusterKit/pull/80