Google 地图聚类不适用于少量坐标

Google map clustering is not working for small count of cordinates

我正在使用 Google Map Clustering 演示应用程序 example 来玩。根据示例中的偏移量如下:

private void readItems() throws JSONException {
    InputStream inputStream = getResources().openRawResource(R.raw.radar_search);
    List<MyItem> items = new MyItemReader().read(inputStream);
    for (int i = 0; i < 5; i++) {
        double offset = i / 60d;
        for (MyItem item : items) {
            LatLng position = item.getPosition();
            double lat = position.latitude + offset;
            double lng = position.longitude + offset;
            MyItem offsetItem = new MyItem(lat, lng);
            mClusterManager.addItem(offsetItem);
        }
    }
}

聚类对于大量坐标 (=>5) 非常有效。为了理解,让我们来看两个场景:

所以,问题是每当我为同一个 Lat,Lng 通过少于 5 个协调员时。 Google 地图不会显示集群。它应该显示为 94.

我试图按照文档进行操作,但没有任何帮助。我在这里做错了什么?

感谢您的帮助。

经过多次尝试。我查看了 Clustercode 并发现:

private int mClusterSize = 4; 

根据您的方便将其更改为。