简体   繁体   English

android-map-extensions奇怪的聚类行为

[英]android-map-extensions weird clustering behavior

I'm currently using android-map-extensions to cluster markers on google map. 我目前正在使用android-map-extensions对Google地图上的标记进行聚类。 However, sometimes two markers are clustered when they are really far, sometimes they have to be almost overlapping each other to be clustered together. 但是,有时两个标记在距离很远时会聚在一起,有时它们必须彼此几乎重叠才能聚在一起。 I've been trying to wrap my head around this for a couple of days and haven't figured it out. 几天来我一直在努力寻找解决方案,但没有弄清楚。 Below is the examples (btw, sorry for the bad english and I don't have enough reputation to post images so imgur to the rescue): 以下是示例(顺便说一句,对不起,英语不好,我没有足够的声誉来发布图像,以免发生救援):

  1. should already clustered : http://imgur.com/MxyN9VI 应该已经群集: http : //imgur.com/MxyN9VI
  2. should not clustered until zoom out far enough (1-2 more zoom level) : http://imgur.com/hVzMQfD 在缩小到足够远(再放大1-2级)之前,不应聚簇: http : //imgur.com/hVzMQfD

How can I fix this, changing the clusterSize as document does not really help 我该如何解决,将clusterSize更改为文档并没有真正的帮助

Android Maps Extensions uses grid based clustering and what you describe is part of how it works. Android Maps Extensions使用基于网格的群集,您所描述的内容是其工作方式的一部分。
You have a couple of options: 您有两种选择:

  1. writing your own clustering strategy for it (eg distance based) 为此编写自己的聚类策略(例如,基于距离)
  2. finding a proper clusterSize for your case; 为您的情况找到合适的clusterSize this might work if all your markers have fixed and static positions; 如果您所有的标记都具有固定和静态位置,则此方法可能会起作用; keep in mind choosing between 128 and 128.1 can make a big difference 请记住,在128和128.1之间进行选择会产生很大的不同
  3. trying out a different library, eg Clusterkraf or Android Maps Utils, which use distance based clusering 尝试使用基于距离的clusering的其他库,例如Clusterkraf或Android Maps Utils

Disclosure: I'm a developer of Android Maps Extensions 披露:我是Android Maps Extensions的开发人员

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM