File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
maps-compose-utils/src/main/java/com/google/maps/android/compose/clustering Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -180,8 +180,14 @@ internal class ComposeUiClusterRenderer<T : ClusterItem>(
180180 val viewInfo = keysToViews.entries
181181 .firstOrNull { (key, _) -> (key as ? ViewKey .Cluster )?.cluster == cluster }
182182 ?.value
183- ? : createAndAddView(cluster.computeViewKeys().first())
184- renderViewToBitmapDescriptor(viewInfo.view)
183+
184+ if (viewInfo != null ) {
185+ renderViewToBitmapDescriptor(viewInfo.view)
186+ } else {
187+ cluster.computeViewKeys().firstOrNull()?.let { key ->
188+ renderViewToBitmapDescriptor(createAndAddView(key).view)
189+ } ? : super .getDescriptorForCluster(cluster)
190+ }
185191 } else {
186192 super .getDescriptorForCluster(cluster)
187193 }
You can’t perform that action at this time.
0 commit comments