ashare80 / TSClusterMapView

MKMapView with animated clustering for iOS and OSX
MIT License
149 stars 21 forks source link

Overlapped annotations when they are in the same coordinates #10

Closed zfrankz closed 8 years ago

zfrankz commented 9 years ago

Hello, I started playing with this library last Friday and is awesome! But while running some tests I found some things.

I found a small issue when I have 2 annotations in the exactly same point, please see the following screenshot. Is there any way to add more displacement to the annotations when they are "de-clustered"? https://www.dropbox.com/s/j9ma2i6x9b9i92b/overlapping.png?dl=0

Another issue is when I have some annotations in the same point, when clustering them, the position of the point changes in the map. (see next screenshots) https://www.dropbox.com/s/7oy7cwex88cgba2/multiple1.png?dl=0 https://www.dropbox.com/s/po5qiw322lc1p09/multiple2.png?dl=0 https://www.dropbox.com/s/xpwewka1xff9a5d/multiple3.png?dl=0

I don't know if this second one might be related to #8

Thanks!

ashare80 commented 9 years ago

@zfrankz Hey thanks for the feedback. I can look into making the displacement larger or a property available to you to change the size. As you can see in https://www.dropbox.com/s/po5qiw322lc1p09/multiple2.png?dl=0 I'm trying to solve that issue but creating a circle around the original point but it's not perfect as it's not really taking into account the size of the annotationView.

Your second point might be related to #8. I have pushed some changes to the Develop branch, let me know if you're still seeing that problem with the new code.

zfrankz commented 9 years ago

I tried the new code as I commented in #11 and the overlapping is still happening (I think there aren't any changes about that thing yet). I think the second one is definitely related to #8

Thanks for the quick response!

riazhazan commented 9 years ago

Do you have any updates for this issue. Still struggling to handle this issue. https://www.dropbox.com/s/po5qiw322lc1p09/multiple2.png?dl=0 @zfrankz did you found any workaround for this issue?

ashare80 commented 9 years ago

@riazhazan What you are displaying is what is supposed to happen. Is it perfect? no.

When you have multiple annotations close enough together and they cannot separate naturally I force separation into a circle around the mutual center coordinate.

If you have any suggestions on your desired outcome I'm open to looking into making a change that improves on the current solution.

riazhazan commented 9 years ago

@ashare80 Thanks for your reply.You have done a wonderful work in this map view which works like a charm. Really amazing library. Please See the screenshot attached what my issue is. See the clusters are overlapped each other. So it looks weird and congested. Is there a way to restrict the number of annotations to show a perfect circle with no overlapping and other annotations as clustered numbers. When the user taps on one cluster the other circle which is already shown in circle can be clustered and the new circle can be created for selected cluster. Is it possible to do so?

ios simulator screen shot 06-aug-2015 9 58 09 am

riazhazan commented 8 years ago

@ashare80 I have a suggestion for this issue.If the annotation count is greater than 15 or if the count of annotations will surely overlaps each other, then can we list these users in a table like a popover. and the user can click on an annotation which is listed in popover table

ashare80 commented 8 years ago

@riazhazan Yeah I was thinking something like a delegate call that would give you the opportunity to do what you wanted with the annotations/annotationViews or default to existing outcome

Might be able to get something up in the next few days

ashare80 commented 8 years ago

@riazhazan check out the latest version going up now. Two new delegate calls. See if that helps resolve your problem.

riazhazan commented 8 years ago

@ashare80 Wow. Thats awesome. Heaps of thanks for your kind support. Loved the way you did it. This is what i exactly needed. :100: