This question already has an answer here:
- Google map marker is replaced by bounding rectangle on zoom 3 answers
I'm trying to implement a cluster marker on my map,first, it shows me the cluster marker but when i zoom in, that expand and also show white square, i'll add some images to explain it better.
images
public class MyItem implements ClusterItem {
private final LatLng mPosition;
String Title = "";
int Icon;
public MyItem(double lat, double lng, String title, int icon) {
mPosition = new LatLng(lat, lng);
Title = title;
Icon = icon;
}
@Override
public LatLng getPosition() {
return mPosition;
}
public String getTitle() {
return Title;
}
public int getIcon() {
return Icon;
}
}
class OwnIconRendered extends DefaultClusterRenderer<MyItem> {
public OwnIconRendered() {
super(MapActivity.this, googleMap, mClusterManager);
}
@Override
protected void onBeforeClusterItemRendered(MyItem item, MarkerOptions markerOptions) {
markerOptions.icon(BitmapDescriptorFactory.fromResource(item.getIcon()));
markerOptions.title(item.getTitle());
super.onBeforeClusterItemRendered(item, markerOptions);
}
@Override
protected void onBeforeClusterRendered(Cluster<MyItem> cluster, MarkerOptions markerOptions) {
super.onBeforeClusterRendered(cluster, markerOptions);
}
}