-
public final class ClusteringKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static ProvidableCompositionLocal<ClusteringMarkerProperties>LocalClusteringMarkerProperties
-
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 UnitClusteringMarkerProperties(Offset anchor, Float zIndex)Helper function to specify properties for the marker representing a cluster or cluster item. final static <T extends ClusterItem> UnitClustering(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> UnitClustering(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> UnitClustering(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> UnitClustering(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()-
-
Method Detail
-
getLocalClusteringMarkerProperties
final ProvidableCompositionLocal<ClusteringMarkerProperties> getLocalClusteringMarkerProperties()
CompositionLocal used to provide ClusteringMarkerProperties to the content of a cluster or cluster item.
-
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 showonClusterClick- a lambda invoked when the user clicks a cluster of itemsonClusterItemClick- a lambda invoked when the user clicks a non-clustered itemonClusterItemInfoWindowClick- a lambda invoked when the user clicks the info window of a non-clustered itemonClusterItemInfoWindowLongClick- a lambda invoked when the user long-clicks the info window of a non-clustered itemclusterContent- 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 imageclusterItemContentAnchor- the anchor for the non-clustered item imageclusterContentZIndex- the z-index of the clusterclusterItemContentZIndex- the z-index of the non-clustered itemclusterRenderer- 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 showonClusterClick- a lambda invoked when the user clicks a cluster of itemsonClusterItemClick- a lambda invoked when the user clicks a non-clustered itemonClusterItemInfoWindowClick- a lambda invoked when the user clicks the info window of a non-clustered itemonClusterItemInfoWindowLongClick- a lambda invoked when the user long-clicks the info window of a non-clustered itemclusterContent- 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 imageclusterItemContentAnchor- the anchor for the non-clustered item imageclusterContentZIndex- the z-index of the clusterclusterItemContentZIndex- 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 showonClusterClick- a lambda invoked when the user clicks a cluster of itemsonClusterItemClick- a lambda invoked when the user clicks a non-clustered itemonClusterItemInfoWindowClick- a lambda invoked when the user clicks the info window of a non-clustered itemonClusterItemInfoWindowLongClick- a lambda invoked when the user long-clicks the info window of a non-clustered itemclusterContent- 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 imageclusterItemContentAnchor- the anchor for the non-clustered item imageclusterContentZIndex- the z-index of the clusterclusterItemContentZIndex- the z-index of the non-clustered itemonClusterManager- 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 showclusterManager- 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 imageclusterItemContentAnchor- the anchor for the non-clustered item imageclusterContentZIndex- the z-index of the clusterclusterItemContentZIndex- the z-index of the non-clustered item
-
rememberClusterManager
@Composable()@MapsComposeExperimentalApi() final static <T extends ClusterItem> ClusterManager<T> rememberClusterManager()
-
-
-
-