Efroz Ghauri
Efroz Ghauri

Reputation: 69

Custom Marker using Google Maps Android API Utility Library

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!

Upvotes: 2

Views: 2331

Answers (1)

Pedro Oliveira
Pedro Oliveira

Reputation: 20500

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();
        }
    }

Upvotes: 2

Related Questions