Browsed by
Tag: google map clustering

Android Google map clustering – how to show actual marker in cluster

Android Google map clustering – how to show actual marker in cluster

1 . Create Custom Cluster renderer package com.findbitcoinatm.android.utils; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.util.SparseArray; import android.view.ViewGroup; import com.findbitcoinatm.android.models.cluster.ATMClusterItems; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.BitmapDescriptor; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.MarkerOptions; import com.google.maps.android.clustering.Cluster; import com.google.maps.android.clustering.ClusterManager; import com.google.maps.android.clustering.view.DefaultClusterRenderer; import com.google.maps.android.ui.IconGenerator; import com.google.maps.android.ui.SquareTextView; public class MyClusterItemRenderer extends DefaultClusterRenderer<ATMClusterItems> { private final IconGenerator mIconGenerator; private final ShapeDrawable mColoredCircleBackground; private final float mDensity; private SparseArray<BitmapDescriptor> mIcons = new SparseArray(); public MyClusterItemRenderer(Context context, GoogleMap map, ClusterManager<ATMClusterItems> clusterManager) { super(context, map, clusterManager); mIconGenerator…

Read More Read More