androiddictionarynutiteq

Handling large amount of Points as VectorDataSource in nutiteq


hello every one hope you having a nice day

in order to load tons of markers (like 1mil) i am passing a list of MapPos to a VectorDataSource and trying to force it to live create the Points whenever related coordinates must be visible to the map now , but unfortunanly after a few try seems i dont know much about the map . would you please help me solve this puzzle ? thaanks alot

 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);

     }

Solution

  • Unfortunately, that's a bit of a large amount to load with clusters. A more scalable solution, however, is to load them to your CARTO account and query them from there (overviews are used).

    cf. android samples: CartoDBSQLDataSource and CartoSQLActivity

    Additionally, if you're open to upgrading your SDK version, you can check out newer samples (master branch)