choefele/CCHMapClusterController

Implementation / Correct behaviour of marginFactor

Closed this issue · 2 comments

Thank you for a great library. I got most of the changes into our application quickly with a minor stumble on the custom annotation views (forgot to set the delegate to enable setTitle).

The particular application we have has around 3000 POIs. Each of these has a polygon overlay. In the current release, we draw all 3000 POI with Overlays - very slow to navigate.

Your library has greatly improved the overall feel and speed almost instantly. However the only issue we have remaining is when we zoom in past a certain point, the Overlays no longer draw.

The Overlays are drawn when we generate the AnnotationViews (in mapView:viewForAnnotation). So it appears that what we expect the marginFactor to do it doesnt seem to:

  • We expected the marginFactor to extend the visible mapview and return a list of Annotations within the CCHMapClusterOperation class

The question is:

  • Is there a way to get the Annotations around the current visible view to draw the POI's Overlays

Hi – the margin factor is used to include additional annotations outside the currently visible area (default is 0.5 for 50% additional area on each side). The margin factor only knows about the annotation locations, though. If your overlays are very large, then this might not be covered.

If you create the overlays in mapView:viewForAnnotation, do you also update them in mapClusterController:willReuseMapClusterAnnotation:? The latter method is called when a cluster annotation is recycled.

I assume this problem has been solved – thanks