Package 

Class ClusteringKt

    • Method Summary

      Modifier and Type Method Description
      final ProvidableCompositionLocal<ClusteringMarkerProperties> getLocalClusteringMarkerProperties() CompositionLocal used to provide ClusteringMarkerProperties to the content of a cluster or cluster item.
      final static Unit ClusteringMarkerProperties(Offset anchor, Float zIndex) Helper function to specify properties for the marker representing a cluster or cluster item.
      final static <T extends ClusterItem> Unit Clustering(Collection<T> items, Function1<Cluster<T>, Boolean> onClusterClick, Function1<T, Boolean> onClusterItemClick, Function1<T, Unit> onClusterItemInfoWindowClick, Function1<T, Unit> onClusterItemInfoWindowLongClick, Function1<Cluster<T>, Unit> clusterContent, Function1<T, Unit> clusterItemContent, Offset clusterContentAnchor, Offset clusterItemContentAnchor, Float clusterContentZIndex, Float clusterItemContentZIndex, ClusterRenderer<T> clusterRenderer, Function1<T, Unit> clusterItemDecoration) Groups many items on a map based on zoom level.
      final static <T extends ClusterItem> Unit Clustering(Collection<T> items, Function1<Cluster<T>, Boolean> onClusterClick, Function1<T, Boolean> onClusterItemClick, Function1<T, Unit> onClusterItemInfoWindowClick, Function1<T, Unit> onClusterItemInfoWindowLongClick, Function1<Cluster<T>, Unit> clusterContent, Function1<T, Unit> clusterItemContent, Offset clusterContentAnchor, Offset clusterItemContentAnchor, Float clusterContentZIndex, Float clusterItemContentZIndex, Function1<T, Unit> clusterItemDecoration) Groups many items on a map based on zoom level.
      final static <T extends ClusterItem> Unit Clustering(Collection<T> items, Function1<Cluster<T>, Boolean> onClusterClick, Function1<T, Boolean> onClusterItemClick, Function1<T, Unit> onClusterItemInfoWindowClick, Function1<T, Unit> onClusterItemInfoWindowLongClick, Function1<Cluster<T>, Unit> clusterContent, Function1<T, Unit> clusterItemContent, Offset clusterContentAnchor, Offset clusterItemContentAnchor, Float clusterContentZIndex, Float clusterItemContentZIndex, Function1<T, Unit> clusterItemDecoration, Function1<ClusterManager<T>, Unit> onClusterManager) Groups many items on a map based on zoom level.
      final static <T extends ClusterItem> Unit Clustering(Collection<T> items, ClusterManager<T> clusterManager, Function1<T, Unit> clusterItemDecoration) Groups many items on a map based on clusterManager.
      final static <T extends ClusterItem> ClusterRenderer<T> rememberClusterRenderer(ClusterManager<T> clusterManager)
      final static <T extends ClusterItem> ClusterRenderer<T> rememberClusterRenderer(Function1<Cluster<T>, Unit> clusterContent, Function1<T, Unit> clusterItemContent, Offset clusterContentAnchor, Offset clusterItemContentAnchor, Float clusterContentZIndex, Float clusterItemContentZIndex, ClusterManager<T> clusterManager) Default Renderer for drawing Composable.
      final static <T extends ClusterItem> ClusterManager<T> rememberClusterManager()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • ClusteringMarkerProperties

        @Composable() final static Unit ClusteringMarkerProperties(Offset anchor, Float zIndex)

        Helper function to specify properties for the marker representing a cluster or cluster item.

        Parameters:
        anchor - the anchor for the marker image.
        zIndex - the z-index of the marker.
      • Clustering

        @Composable()@MapsComposeExperimentalApi()@Deprecated(message = If clusterRenderer is specified, clusterContent and clusterItemContent are not used; use a function that takes ClusterManager as an argument instead., replaceWith = @ReplaceWith(imports = {com.google.maps.android.compose.clustering.Clustering, androidx.compose.runtime.SideEffect, com.google.maps.android.clustering.ClusterManager}, expression = 
                    val clusterManager = rememberClusterManager<T>()
                    LaunchedEffect(clusterManager, clusterRenderer) {
                        clusterManager?.renderer = clusterRenderer
                    }
                    SideEffect {
                        clusterManager ?: return@SideEffect
                        clusterManager.setOnClusterClickListener(onClusterClick)
                        clusterManager.setOnClusterItemClickListener(onClusterItemClick)
                        clusterManager.setOnClusterItemInfoWindowClickListener(onClusterItemInfoWindowClick)
                        clusterManager.setOnClusterItemInfoWindowLongClickListener(onClusterItemInfoWindowLongClick)
                    }
                    // Wait for renderer to apply before clustering
                    if (clusterManager != null && clusterManager.renderer == clusterRenderer) {
                        Clustering(
                            items = items,
                            clusterManager = clusterManager,
                        )
                    }
                )) final static <T extends ClusterItem> Unit Clustering(Collection<T> items, Function1<Cluster<T>, Boolean> onClusterClick, Function1<T, Boolean> onClusterItemClick, Function1<T, Unit> onClusterItemInfoWindowClick, Function1<T, Unit> onClusterItemInfoWindowLongClick, Function1<Cluster<T>, Unit> clusterContent, Function1<T, Unit> clusterItemContent, Offset clusterContentAnchor, Offset clusterItemContentAnchor, Float clusterContentZIndex, Float clusterItemContentZIndex, ClusterRenderer<T> clusterRenderer, Function1<T, Unit> clusterItemDecoration)

        Groups many items on a map based on zoom level.

        Parameters:
        items - all items to show
        onClusterClick - a lambda invoked when the user clicks a cluster of items
        onClusterItemClick - a lambda invoked when the user clicks a non-clustered item
        onClusterItemInfoWindowClick - a lambda invoked when the user clicks the info window of a non-clustered item
        onClusterItemInfoWindowLongClick - a lambda invoked when the user long-clicks the info window of a non-clustered item
        clusterContent - an optional Composable that is rendered for each Cluster.
        clusterItemContent - an optional Composable that is rendered for each non-clustered item.
        clusterContentAnchor - the anchor for the cluster image
        clusterItemContentAnchor - the anchor for the non-clustered item image
        clusterContentZIndex - the z-index of the cluster
        clusterItemContentZIndex - the z-index of the non-clustered item
        clusterRenderer - an optional ClusterRenderer that can be used to specify the algorithm used by the rendering.
      • Clustering

        @Composable()@MapsComposeExperimentalApi() final static <T extends ClusterItem> Unit Clustering(Collection<T> items, Function1<Cluster<T>, Boolean> onClusterClick, Function1<T, Boolean> onClusterItemClick, Function1<T, Unit> onClusterItemInfoWindowClick, Function1<T, Unit> onClusterItemInfoWindowLongClick, Function1<Cluster<T>, Unit> clusterContent, Function1<T, Unit> clusterItemContent, Offset clusterContentAnchor, Offset clusterItemContentAnchor, Float clusterContentZIndex, Float clusterItemContentZIndex, Function1<T, Unit> clusterItemDecoration)

        Groups many items on a map based on zoom level.

        Parameters:
        items - all items to show
        onClusterClick - a lambda invoked when the user clicks a cluster of items
        onClusterItemClick - a lambda invoked when the user clicks a non-clustered item
        onClusterItemInfoWindowClick - a lambda invoked when the user clicks the info window of a non-clustered item
        onClusterItemInfoWindowLongClick - a lambda invoked when the user long-clicks the info window of a non-clustered item
        clusterContent - an optional Composable that is rendered for each Cluster.
        clusterItemContent - an optional Composable that is rendered for each non-clustered item.
        clusterContentAnchor - the anchor for the cluster image
        clusterItemContentAnchor - the anchor for the non-clustered item image
        clusterContentZIndex - the z-index of the cluster
        clusterItemContentZIndex - the z-index of the non-clustered item
      • Clustering

        @Composable()@MapsComposeExperimentalApi() final static <T extends ClusterItem> Unit Clustering(Collection<T> items, Function1<Cluster<T>, Boolean> onClusterClick, Function1<T, Boolean> onClusterItemClick, Function1<T, Unit> onClusterItemInfoWindowClick, Function1<T, Unit> onClusterItemInfoWindowLongClick, Function1<Cluster<T>, Unit> clusterContent, Function1<T, Unit> clusterItemContent, Offset clusterContentAnchor, Offset clusterItemContentAnchor, Float clusterContentZIndex, Float clusterItemContentZIndex, Function1<T, Unit> clusterItemDecoration, Function1<ClusterManager<T>, Unit> onClusterManager)

        Groups many items on a map based on zoom level.

        Parameters:
        items - all items to show
        onClusterClick - a lambda invoked when the user clicks a cluster of items
        onClusterItemClick - a lambda invoked when the user clicks a non-clustered item
        onClusterItemInfoWindowClick - a lambda invoked when the user clicks the info window of a non-clustered item
        onClusterItemInfoWindowLongClick - a lambda invoked when the user long-clicks the info window of a non-clustered item
        clusterContent - an optional Composable that is rendered for each Cluster.
        clusterItemContent - an optional Composable that is rendered for each non-clustered item.
        clusterContentAnchor - the anchor for the cluster image
        clusterItemContentAnchor - the anchor for the non-clustered item image
        clusterContentZIndex - the z-index of the cluster
        clusterItemContentZIndex - the z-index of the non-clustered item
        onClusterManager - an optional lambda invoked with the clusterManager as a param when both the clusterManager and renderer are set up, allowing callers a customization hook.
      • Clustering

        @Composable()@MapsComposeExperimentalApi() final static <T extends ClusterItem> Unit Clustering(Collection<T> items, ClusterManager<T> clusterManager, Function1<T, Unit> clusterItemDecoration)

        Groups many items on a map based on clusterManager.

        Parameters:
        items - all items to show
        clusterManager - a ClusterManager that can be used to specify the algorithm used by the rendering.
      • rememberClusterRenderer

        @Composable()@MapsComposeExperimentalApi() final static <T extends ClusterItem> ClusterRenderer<T> rememberClusterRenderer(ClusterManager<T> clusterManager)
      • rememberClusterRenderer

        @Composable()@MapsComposeExperimentalApi() final static <T extends ClusterItem> ClusterRenderer<T> rememberClusterRenderer(Function1<Cluster<T>, Unit> clusterContent, Function1<T, Unit> clusterItemContent, Offset clusterContentAnchor, Offset clusterItemContentAnchor, Float clusterContentZIndex, Float clusterItemContentZIndex, ClusterManager<T> clusterManager)

        Default Renderer for drawing Composable.

        Parameters:
        clusterContent - an optional Composable that is rendered for each Cluster.
        clusterItemContent - an optional Composable that is rendered for each non-clustered item.
        clusterContentAnchor - the anchor for the cluster image
        clusterItemContentAnchor - the anchor for the non-clustered item image
        clusterContentZIndex - the z-index of the cluster
        clusterItemContentZIndex - the z-index of the non-clustered item
      • rememberClusterManager

        @Composable()@MapsComposeExperimentalApi() final static <T extends ClusterItem> ClusterManager<T> rememberClusterManager()