How can I reduce the number of annotations on a map?

后端 未结 6 1473
时光说笑
时光说笑 2020-12-13 11:03

I\'m coding a map view with around 900 annotations. Having this many annotations on a map make the performance suffer, so I\'d like to reduce it to about 300 at a time. The

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 11:16

    If a commercial, third party library is an option, check out Superpin (license costs $199). It is an iOS Framework that internally uses quadtrees for annotation storage and performs grid-based clustering. The algorithm is quite fast, the included sample app is showing airports of the world (more than 30k+ annotations) and it's running quite smooth on an 3G iPhone.

    You may also want to check http://revolver.be/blog/mapkit-clustering-with-ios/, another ready-made solution, which is free for non-commerical projects.

    Disclaimer: I'm one of the Superpin developers

提交回复
热议问题