0

When i change the position of marker it doesn't get changed until i zoom in and zoom out in android, Also the cluster flicker markers whose position get change also get clustered with cluster at other positions how to solve this issue.

And code i use to change the position of markers is

for (int j = 0; j < person_markerList.size(); j++) {

                    if(person_markerList.get(j).name.equals("Shivam")||person_markerList.get(j).name.equals("Goury"))
                    {
                        person_markerList.get(j).setPosition(new LatLng(28.612053,77.255001));
                        person_markerList.get(j).setAddress(getAddress(new LatLng(28.612053,77.255001)));

                    }   
                }

Please help me out

Hitesh Singh
  • 1,951
  • 1
  • 10
  • 15
Edward Collins
  • 353
  • 3
  • 13
  • try to refresh google map as according to your requirement and also remove all marker from map like this : if(mMap != null){ mMap.clear(); } and again add marker to google map – Hitesh Singh May 01 '15 at 06:44
  • I wanna update the marker position without clearing the markers in android – Edward Collins May 01 '15 at 06:46
  • http://stackoverflow.com/questions/15905359/how-to-change-the-position-of-a-marker-on-a-android-map-v2 – Alexander R. May 01 '15 at 06:48
  • @AlexanderRavikovich But i am using android map utiliy librray and i also have some clustered markeres on map – Edward Collins May 01 '15 at 06:49
  • @Edward Collins you need to clear map first then update your marker new position other wise on map marker will show twice or more then that because it will show marker on last position so for this reason i telling you clear map first and update your marker it will look like what you exactly want. – Hitesh Singh May 01 '15 at 06:55
  • @HiteshSingh it will take time in reloading map....i am tracking my employees, every time i clear the map add markers again is time consuming process, So can you please tell another way to refresh the map without zooming in and out – Edward Collins May 01 '15 at 07:05
  • 2
    You don't need to clear the whole map, instead of, you need to save the `Marker object` which you want to delete in an array, and then clear it by using `remove()` method. – bjiang May 01 '15 at 16:42

0 Answers0