Исправлено с переопределением getDescriptorForCluster
private val mClusterIconGenerator = IconGenerator(context).apply {
setBackground(context?.let { ContextCompat.getDrawable(it, R.drawable.map_cluster_item) })
setTextAppearance(R.style.WhiteTextAppearance)
}
override fun onBeforeClusterRendered(cluster: Cluster<T>, markerOptions: MarkerOptions) {
val icon = mClusterIconGenerator.makeIcon(cluster.size.toString())
markerOptions.icon(BitmapDescriptorFactory.fromBitmap(icon));
}
override fun getDescriptorForCluster(cluster: Cluster<T>): BitmapDescriptor {
val icon = mClusterIconGenerator.makeIcon(cluster.size.toString())
return BitmapDescriptorFactory.fromBitmap(icon)
}