iPhone的MKMapView注释聚类 [英] iPhone MKMapView Annotation Clustering
问题描述
我已经得到了很多针把我的地图,所以我认为这将是一个不错的主意,这些集群的注释。我真的不知道如何实现这一点在iPhone上,我能想些办法与谷歌地图和一些JavaScript的例子。但是iPhone使用它的MKMapView,我不知道如何在那里聚集的注解。
I've got quite a lot of pins to put on my map so I think it would be a nice idea to cluster those annotations. I'm not really sure how to achieve this on iPhone, I was able to work something out with google maps and some javascript examples. But iPhone uses its mkmapview and I have no idea how to cluster annotations in there.
任何想法,或者你知道是好的框架吗?谢谢你。
Any ideas or frameworks that you know and are good? Thanks.
推荐答案
由于这是一个非常普遍的问题,我需要一个解决方案我已经写的MKMapView的自定义子类,支持集群。然后我做到了开放源码! https://github.com/yinkou/OCMapView :你可以在这里得到它。
Since this is a very common problem and i needed a solution i have wrote a custom subclass of MKMapView which supports clustering. Then i made it available open source! You can get it here: https://github.com/yinkou/OCMapView.
它管理注释的集群,你可以自己处理自己的看法。
你不必做任何事情,但到 OCMapView
文件夹复制到你的项目,在你的笔尖创建一个的MKMapView
并设置其类 OCMapView
。 (或创建并委托其在code像一个普通的的MKMapView
)
It manages the clustering of the annotations and you can handle their views by yourself.
You don't have to do anything but to copy the OCMapView
folder to your project, create a MKMapView
in your nib and set its class to OCMapView
. (Or create and delegate it in code like a regular MKMapView
)
这篇关于iPhone的MKMapView注释聚类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!