REMarkerClusterer
REMarkerClusterer copied to clipboard
Declustering not always working
Example: 3 pins on the map -> zoom out -> 1 pin on the map (works every single time) -> zoom in -> :
- goes well (for a maximum of 3 consecutive zoom out/in)
- goes fairly bad declusters only 1 pin (resulting in 2 total pins)
- goes really bad declusters none of the clustered pins (only one pin on the map, the cluster one).
I cannot find pattern on which this is happening... Please take a look if you can, i really like your implementation.
Thanks!
I found that the problem is here... Code in REMarkerClusterer.m:
if (self.markerAnnotations.count == 0) { [_mapView addAnnotations:_clusters]; } else if (self.markerAnnotations.count > _clusters.count) { [self joinAnnotationsWithDictionary:dic]; //[self addAnnotationsWithOutSpliting:remainingAnnotations]; } else if(self.markerAnnotations.count < _clusters.count) { [self splitAnnotationsWithDictionary:dic]; } else { }
Dunno why but sometimes, if this "if (self.markerAnnotations.count > _clusters.count)" is false, it won't check this "if(self.markerAnnotations.count < _clusters.count)".
I don't understand...
Did this get fixed?
Unfortunately no answer yet... I adapted and started using another library.
I believe this is fixed by pull request #31.