android - how to customize the google marker cluster renderer? -
in application have put more 50k markers on google maps. want customize marker cluster renderer. number displayed on marker wasn't correct displays wrong number haven't contains number pins displays on marker. please me solve problem. using following code cluster markers:
mmap.movecamera(cameraupdatefactory.newlatlngzoom(new latlng(51.503186, -0.126446), 10)); // initialize manager context , map. // (activity extends context, can pass 'this' in constructor.) mclustermanager = new clustermanager<myitem>(this, mmap); mclustermanager.setrenderer(new myclusterrenderer<myitem>(this, mmap,mclustermanager)); // point map's listeners @ listeners implemented cluster // manager. mmap.setoncamerachangelistener(mclustermanager); mmap.setonmarkerclicklistener(mclustermanager); additems();
function add items
private void additems() { (int = 0; < placescoordinates.size(); i++) { myitem offsetitem = new myitem(placescoordinates.get(i).getlat(), placescoordinates.get(i).getlng()); mclustermanager.additem(offsetitem); } }
data set of coordinates:
placescoordinates.add(new places(40.763557,-73.972302,true)); placescoordinates.add(new places(40.762123,-73.974824,true)); placescoordinates.add(new places(40.722165,-73.999198,true)); placescoordinates.add(new places(40.758037,-73.97699 ,true)); placescoordinates.add(new places(40.750718,-73.988592,true)); placescoordinates.add(new places(40.763502,-73.97395 ,true)); placescoordinates.add(new places(40.757155,-73.978499,true)); placescoordinates.add(new places(40.720076,-73.997571,true)); placescoordinates.add(new places(40.721643,-74.000222,false)); placescoordinates.add(new places(40.752877,-73.99622 ,true)); placescoordinates.add(new places(40.743386,-73.993546,true)); placescoordinates.add(new places(40.7403, -73.995,true)); placescoordinates.add(new places(40.706925,-74.004398,true)); placescoordinates.add(new places(40.7225, -73.988314,true)); placescoordinates.add(new places(40.721334,-73.988946,true)); placescoordinates.add(new places(40.760245,-73.984354,true)); placescoordinates.add(new places(40.711741,-74.008775,true)); placescoordinates.add(new places(40.734311,-73.990107,true)); placescoordinates.add(new places(40.760964,-73.968482,true)); placescoordinates.add(new places(40.762424,-73.973481,true)); placescoordinates.add(new places(40.762424,-73.973481,true)); placescoordinates.add(new places(40.73487,-73.991409 ,true)); placescoordinates.add(new places(40.761488,-73.967123,true)); placescoordinates.add(new places(40.795354,-73.931178,true)); placescoordinates.add(new places(40.784815,-73.979711,true)); placescoordinates.add(new places(40.739037,-73.995811,true)); placescoordinates.add(new places(40.734279,-73.990288,false)); placescoordinates.add(new places(40.724569,-73.996485,false)); placescoordinates.add(new places(40.741841,-73.992895,false)); placescoordinates.add(new places(40.739293,-73.994109,false)); placescoordinates.add(new places(40.725744,-73.996881,false)); placescoordinates.add(new places(40.712914,-74.007793,false)); placescoordinates.add(new places(40.760388,-73.98506 ,false)); placescoordinates.add(new places(40.72562,-73.999731 ,false)); placescoordinates.add(new places(40.735868,-74.004994,false)); placescoordinates.add(new places(40.742092,-73.991766,false)); placescoordinates.add(new places(40.758243,-73.984917,false)); placescoordinates.add(new places(40.738153,-73.989673,false)); placescoordinates.add(new places(40.722836,-73.999158,false)); placescoordinates.add(new places(40.741049,-73.991926,false)); placescoordinates.add(new places(40.762424,-73.973481,false)); placescoordinates.add(new places(40.73487,-73.991409 ,false)); placescoordinates.add(new places(40.761488,-73.967123,false)); placescoordinates.add(new places(40.795354,-73.931178,false)); placescoordinates.add(new places(40.784815,-73.979711,false)); placescoordinates.add(new places(40.739037,-73.995811,false)); placescoordinates.add(new places(40.734279,-73.990288,false)); placescoordinates.add(new places(40.724569,-73.996485,false)); placescoordinates.add(new places(40.741841,-73.992895,true)); placescoordinates.add(new places(40.739293,-73.994109,true)); placescoordinates.add(new places(40.725744,-73.996881,true)); placescoordinates.add(new places(40.712914,-74.007793,true)); placescoordinates.add(new places(40.760388,-73.98506 ,true)); placescoordinates.add(new places(40.72562,-73.999731 ,true)); placescoordinates.add(new places(40.735868,-74.004994,true)); placescoordinates.add(new places(40.742092,-73.991766,true)); placescoordinates.add(new places(40.758243,-73.984917,true)); placescoordinates.add(new places(40.738153,-73.989673,true)); placescoordinates.add(new places(40.722836,-73.999158,true)); placescoordinates.add(new places(40.741049,-73.991926,true));
after spending complete day on debugging came know problem not cluster marker numbering, problem data set. contains similar coordinates multiple times.
Comments
Post a Comment