REMarkerClusterer icon indicating copy to clipboard operation
REMarkerClusterer copied to clipboard

Declustering not always working

Open tudorcodarnai opened this issue 10 years ago • 4 comments

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!

tudorcodarnai avatar Apr 06 '14 12:04 tudorcodarnai

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...

tudorcodarnai avatar Apr 06 '14 13:04 tudorcodarnai

Did this get fixed?

holidaycottages avatar May 08 '14 08:05 holidaycottages

Unfortunately no answer yet... I adapted and started using another library.

tudorcodarnai avatar May 08 '14 09:05 tudorcodarnai

I believe this is fixed by pull request #31.

MarkCSmith avatar Jan 21 '15 21:01 MarkCSmith