yuvaraj119 / android-maps-extensions

android-maps-extensions
0 stars 0 forks source link

map.clear() doesn't work properly #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the DemoActivity replace OnClusterClick with this:

public void onClusterClick(View view) {
    map.clear();
    map.setClustering(new ClusteringSettings().iconDataProvider(new DemoIconProvider(getResources())));
        MarkerGenerator.addMarkersInPoland(map);
        MarkerGenerator.addMarkersInWorld(map);
    }

Then run the app and click Cluster twice

When inserting a lot of data like in the above example you'll see appearing the 
markers and then the clusters.

It could be useful some function to massively add markers and directly display 
the clusters without inserting and deleting the markers on the map

Original issue reported on code.google.com by verna...@gmail.com on 20 Mar 2013 at 9:53

GoogleCodeExporter commented 9 years ago

Original comment by maciek.g...@gmail.com on 22 Mar 2013 at 1:29

GoogleCodeExporter commented 9 years ago
This appears to be a bug in DelegatingGoogleMap.clear() implementation.

For now you can change map.clear() with the following code:

for (Marker marker : map.getMarkers()) {
    marker.remove();
}

Original comment by maciek.g...@gmail.com on 22 Mar 2013 at 1:37

GoogleCodeExporter commented 9 years ago
Issue 2 has been merged into this issue.

Original comment by maciek.g...@gmail.com on 24 Mar 2013 at 6:30

GoogleCodeExporter commented 9 years ago

Original comment by maciek.g...@gmail.com on 24 Mar 2013 at 6:31

GoogleCodeExporter commented 9 years ago
map.clear() should be working as of version 1.1.

Thank you for reporting both issues. I haven't even used clear() before.

Original comment by maciek.g...@gmail.com on 24 Mar 2013 at 6:53

GoogleCodeExporter commented 9 years ago
As a side note. Using map.clear() might not be the best choice for now because 
of the bug in Google Play Services library: 
https://code.google.com/p/gmaps-api-issues/issues/detail?id=4703

Original comment by maciek.g...@gmail.com on 26 Mar 2013 at 11:34