OCMapView icon indicating copy to clipboard operation
OCMapView copied to clipboard

Annotations in same coordinate

Open bizibizi opened this issue 11 years ago • 5 comments

Hello, I like you lib!

What should I do if I have Annotations in same coordinate? They can not be separated I want to see separated annotationViews

bizibizi avatar Apr 14 '14 05:04 bizibizi

I don't quite understand what you want. Can rephrase your question or explain it in detail? I don't understand because it makes imho no sense to select multiple annotations in a cluster. Because it is clustered.

BotiKis avatar Apr 14 '14 06:04 BotiKis

I think I have the same problem as bizlbizi. I use callout views for the single annotations and that works perfectly fine. But, if I have more than one annotations on the same coordinate, and if I zoom in as much as it is allowed, I still have a cluster view, and it's not clickable, so I can't access any callout view. I would like to know if I can make that cluster view clickable, so I can show information about the annotations, even if they are on the same coordinate. Great lib though.

AndrejTrajkovski avatar Feb 19 '15 09:02 AndrejTrajkovski

Hi,

I still not understand the issue. The cluster Annotation selection should be normally handled by the delegate with mapView:didSelectAnnotationView: so you can resolve the touch.
You also can resolve a cluster with annotations at the same coordinate by setting the minLongitudeDeltaToCluster or minimumAnnotationCountPerCluster properties accordingly.

BotiKis avatar Feb 19 '15 09:02 BotiKis

Sorry for the clumsy explanation. Another way to put it will be: No matter how much I zoom in, if I have annotations on the same coordinate, I will always have a green circle with a number in it, and if I click on it, nothing happens ( the mapView:didSelectAnnotationView: does not get called). Probably because the green circle is an overlay, and not an annotation. I guess one solution will be not to call updateOverlays if the zoom level is maxed out, but that might be hard to implement. Any other suggestions you might have are welcomed.

AndrejTrajkovski avatar Feb 19 '15 09:02 AndrejTrajkovski

First if mapView:didSelectAnnotationView: does not get called, theres a bug lol. Can you try it without any overlays? Or try to call *bringSubviewToFront:` with all annotations -> hacky...

Anyway you still can set minLongitudeDeltaToCluster to a small value so it wont cluster it if zoomed in.
In addition to that you can also add all annotation with the same coordinates to the annotationsToIgnore property of the mapview so they will never be clustered.

BotiKis avatar Feb 19 '15 13:02 BotiKis