Edward Collins
Edward Collins

Reputation: 353

Adding new markers on map using cluster manager doesn't reflect the changes until I zoom in and zoom out the map

When I add new markers on the map programmatically using cluster manager it doesn't reflect the changes until I update the zoom in and zoom out.

I have seen lots of questions on stack overflow but that doesn't work for me,

So please tell me how to update the map without clearing the map.

Code:

 for (int i = 0; i < name.length; i++)
 { 
   Person_marker person_marker = new Person_marker(createRandLocation(latLng),
   name[i], getAddress(latLng), typedArray.getResourceId(i, -1), time[i], acuracy[i]);
   person_markerList.add(person_marker);
 } 
clusterManager.clearItems(); clusterManager.addItems(person_markerList);

Upvotes: 18

Views: 4032

Answers (1)

k3v1n4ud3
k3v1n4ud3

Reputation: 2994

After adding all the markers, if you call clusterManager.cluster() it will draw what's been previsouly added.

Hope this helps

Upvotes: 33

Related Questions