Skip to content

Huge drop in performances when setting custom clusterContent or clusterItemContent with many items #380

Description

@AdrienDruesne

Hello,

While using the Clustering in the com.google.maps.android:maps-compose-utils:2.13.0 library, if I customize the clusterContent or clusterItemContent, I have a huge drop in performances with 100+ items.
Even for a simple composable as the one below, the app stutter when I move on the map, but I don't have any problem if I leave clusterContent and clusterItemContent to null.

     clusterContent = { cluster ->
             Surface(
                 Modifier.size(40.dp),
                 shape = CircleShape,
                 color = Color.Blue,
                 contentColor = Color.White,
                 border = BorderStroke(1.dp, Color.White)
             ) {
                 Box(contentAlignment = Alignment.Center) {
                     Text(
                         "%,d".format(cluster.size),
                         fontSize = 16.sp,
                         fontWeight = FontWeight.Black,
                         textAlign = TextAlign.Center
                     )
                 }
             }
         },

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.releasedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions