问题描述
我有很多图钉要放在我的地图上,所以我认为将这些注释聚集在一起是个好主意.我不太确定如何在 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 文件夹复制到您的项目中,在您的 nib 中创建一个 MKMapView 并将其类设置为 OCMapView.(或者像常规的 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 注解聚类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)