在 nutiteq 中处理大量点作为 VectorDataSource

Handling large amount of Points as VectorDataSource in nutiteq

大家好希望你们今天过得愉快

为了加载大量标记(如 1mil),我将 MapPos 列表传递给 VectorDataSource 并试图强制它在相关坐标现在必须对地图可见时创建点,但不幸的是之后几次尝试似乎我对地图不太了解。你能帮我解决这个难题吗?非常感谢

 public static void createlustering(Projection proj,MapView mapView,Context context,final Bitmap bmp,float distance,float textSize,final ArrayList<MapPos> points){

         AbstractVectorDataSource<Geometry> source = new AbstractVectorDataSource<Geometry>(proj) {

            @Override
            public Collection<Geometry> loadElements(CullState arg0) {

                //what to do here

                return list;
            }

            @Override
            public Envelope getDataExtent() {

                //what to do here
                return null;
            }
        };
        // source.addAll(points);

         Clusterer mClusterer = new Clusterer();
         mClusterer.addPointCluster(mapView, context,source,bmp,distance,textSize);

     }

不幸的是,集群的加载量有点大。然而,更具可扩展性的解决方案是将它们加载到您的 CARTO 帐户并从那里查询它们(使用概览)。

比照。 android 个样本:CartoDBSQLDataSource and CartoSQLActivity

此外,如果您愿意升级您的 SDK 版本,您可以查看更新的示例(master 分支)