thoughtbot / TBAnnotationClustering

Example App: How To Efficiently Display Large Amounts of Data on iOS Maps
http://robots.thoughtbot.com/how-to-handle-large-amounts-of-data-on-maps/
MIT License
728 stars 125 forks source link

is it possible to load the annotations from quad tree without clustering them and without lag when scrolling the map? #16

Open acenivek opened 7 years ago

acenivek commented 7 years ago

I need to show a massive amount of annotations without clustering on a map but when I try it, the map scrolling have a lot of lag. I think that your quad tree maybe is the solution but I wasn't capable of load the annotations from the quad tree before they have been clustered. Can you help me?

zhouhao27 commented 7 years ago

How do you load annotations without clustering?

For you case, I think you should only show the annotations above certain zoom level.

acenivek commented 7 years ago

Zhouhao27 normally I know that the best is to load them clustered but my superiors want to test a massive amount of points loaded on the map on the last zoom level. The example will be to load 10,000 coordinate points on the area of México country and when do you zoom it will only show the points referring to an smaller area like an state of mexico. Using this project I think that the quad tree can do it but I'm no so skilled to know how to remove the cluster of its code to show all the points that we have on a data base, can you help me?

zhouhao27 commented 7 years ago

Check clusteredAnnotationsWithinMapRect function, you'll find there is only one annotation is added when count > 1. You can add every annotation inside TBQuadTreeGatherDataInRange function.