多个批注(IOS)最简单的方法 [英] Multiple Annotations (IOS) Easiest way

查看:284
本文介绍了多个批注(IOS)最简单的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时通讯使用注释在IOS显示伦敦地铁站,但即时通讯看着数字,有280左右。
请告诉我最简单的方式做到这一点?
单独或有另一种选择?

Im using Annotations in IOS to display London Tube stations, but im looking at numbers and there are 280 or so. Whats the easiest way to do this? Individually or is there another option?

对于所有的建议干杯

大卫

推荐答案

表现还是不错的280注解,外观是没有的。你必须将它们分组到集群中,当用户缩小。

The performance is good with 280 annotations, the appearance is not. You have to group them into clusters when the user zooms out.

做到这一点的方法之一是:

One way to do it is:


  • 决定你要多少集群注解显现。

  • 斯普利特的X * Y瓷砖屏幕,这样的大致 X * Y =〜numClusters X / Y =三百二十零分之四百八十〇= 1.5

  • 添加每瓦集群注释(它与含有0或多个注释数组正常的集群)。

  • 运行 k-means算法

    • 迭代的所有注释,并添加每一个到最近的集群。

    • 计算每个集群,这将是其所有成员的中心平均一个新的中心。

    • 空缺每个集群。

    • 重复,直到没有任何集群移动不再

    • 如果任何
    • 删除空集群,
    • Decide how many cluster annotations you want to show.
    • Split the screen in x*y tiles so roughly x*y =~ numClusters and x/y=480/320=1.5
    • Add a cluster annotation per tile (it's a normal cluster with an array containing 0 or more annotations).
    • Run the k-means algorithm:
      • Iterate all annotations and add each one to the closest cluster.
      • Calculate a new center for each cluster, which will be an average of the centers of all its members.
      • Empty each cluster.
      • Repeat until no cluster moves any longer.
      • Remove empty clusters, if any.

      您结束了 numClusters 集群定位根据注释密度

      You end up with numClusters clusters positioned according to the annotation density.

      您也可以留下自己的一些正常的注解,如果他们是从集群的路程。取决于你想怎么看。

      You can also leave a number of normal annotations on their own if they are away from the clusters. Depends on how you want it to look.

      这篇关于多个批注(IOS)最简单的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆