2
votes

I'm using Google Maps Android API Utility Library in order to show several markers in a map in a clustered way. I can't find a way to change default red marker to custom marker

Does anybody have any idea about thisenter image description here?

Thanks a lot in advance!

1
Roman Zhukov , I checked the official link but they did't mention anything about to change default red icon to custom. Only Customize the marker of clusters - Efroz Ghauri
how did you change, kindly post code me also struggling with same issue - Madhu

1 Answers

2
votes

In order to change the marker you need to override the onClusterItemRendered method of your custom renderer.

Then change it like this:

  @Override
    protected void onClusterItemRendered(ListingCluster clusterItem, final Marker marker) {
        super.onClusterItemRendered(clusterItem, marker);
        try {
            marker.setIcon(BitmapDescriptorFactory.fromResource(R.drawable.map_marker_detail));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }