hulab / ClusterKit

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

[Mapbox] Using ClusterKit with MGLPointAnnotation #35

Closed afomich closed 6 years ago

afomich commented 6 years ago

Hello! Thanks for ClusterKit!

I have a project with tons of MGLPointAnnotation (with custom icons) and etc. I do not use GeoJSON, all points are added dynamically. I found the way how to utilize ClusterKit with annotationViews, and it works, but I have a duplicates for every PointAnnotation and other problems. Is there any simple way to use this kit for MGLPointAnnotations, not for MGLAnnotationView?

afomich commented 6 years ago

The main problem is that I encounter such a "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PointAnnotation count]: unrecognized selector sent to instance 0x1c1069000'" error in - (nullable MGLAnnotationView )mapView:(MGLMapView )mapView viewForAnnotation:(id )annotation

afomich commented 6 years ago

@interface PointAnnotation : MGLPointAnnotation

@property (strong, nonatomic) id userInfo; @property (strong, nonatomic) NSString type; @property (strong, nonatomic) NSNumber marker_id;

@end

chinna834 commented 6 years ago

Could you please explain your approach for this issue. I have the same issue.