Skip to Content
API ReferenceMapLzClusterModel

LzClusterModel

data class LzClusterModel(val identifier: String, val points: List<LatLng>, val clusterRadius: Int = 50, val clusterMaxZoom: Int = 22, val unclusteredColor: String = "#2196F3", val unclusteredRadius: Float = 6.0f, val clusterColors: List<String> = listOf("#4CAF50", "#FF9800", "#F44336"), val clusterRadii: List<Float> = listOf(20f, 30f, 40f), val clusterThresholds: List<Int> = listOf(0, 10, 50))

Describes a clustered point layer to be drawn on the map.

Clusters automatically group nearby points at lower zoom levels, showing a single circle with the point count. As the user zooms in, clusters expand to reveal individual points. Supports multiple tiers with different colors and sizes based on point count thresholds.

Matches the iOS SDK’s LZClusterModel for cross-platform parity.

Constructors

LzClusterModelconstructor(identifier: String , points: List <LatLng>, clusterRadius: Int  = 50, clusterMaxZoom: Int  = 22, unclusteredColor: String  = “#2196F3”, unclusteredRadius: Float  = 6.0f, clusterColors: List <String > = listOf(“#4CAF50”, “#FF9800”, “#F44336”), clusterRadii: List <Float > = listOf(20f, 30f, 40f), clusterThresholds: List <Int > = listOf(0, 10, 50))

Properties

clusterColors

val clusterColors: List<String>

List of hex colors for each cluster tier (low → high count).

clusterMaxZoom

val clusterMaxZoom: Int = 22

Maximum zoom level at which clustering is applied. Above this zoom, all points render individually.

clusterRadii

val clusterRadii: List<Float>

List of circle radii in dp for each cluster tier.

clusterRadius

val clusterRadius: Int = 50

Pixel radius within which points are grouped into a cluster.

clusterThresholds

val clusterThresholds: List<Int>

List of point-count thresholds that define tier boundaries. Must be sorted ascending. Each tier covers counts from its threshold up to (but not including) the next threshold.

identifier

val identifier: String

Unique identifier used to reference this cluster for removal.

points

val points: List<LatLng>

List of lat/lng positions to cluster.

unclusteredColor

val unclusteredColor: String

Hex color for individual (unclustered) points.

unclusteredRadius

val unclusteredRadius: Float = 6.0f

Radius in dp for individual point circles.

Last updated on