lustre_kakaomap/clusterer

Marker clusterer for KakaoMap.

Groups nearby markers into clusters for better performance and visual clarity at lower zoom levels. Requires the “clusterer” library in the KakaoMap SDK script tag.

Types

Options for clusterer initialization.

pub opaque type ClustererOption

Values

pub fn add_marker(
  id id: String,
  clusterer_id clusterer_id: String,
  marker_id marker_id: String,
) -> effect.Effect(msg)

Adds a marker to the clusterer.

pub fn average_center(enabled: Bool) -> ClustererOption

Sets whether to use the average center of clustered markers.

pub fn clear(
  id id: String,
  clusterer_id clusterer_id: String,
) -> effect.Effect(msg)

Removes all markers from the clusterer.

pub fn destroy(
  id id: String,
  clusterer_id clusterer_id: String,
) -> effect.Effect(msg)

Destroys a clusterer and cleans up resources.

pub fn disable_click_zoom(disabled: Bool) -> ClustererOption

Disables zoom on cluster click.

pub fn grid_size(size: Int) -> ClustererOption

Sets the grid size in pixels for clustering.

pub fn init(
  id id: String,
  clusterer_id clusterer_id: String,
  options options: List(ClustererOption),
) -> effect.Effect(msg)

Initializes a clusterer on the given map.

clusterer.init(id: "mymap", clusterer_id: "cl1", options: [
  clusterer.grid_size(60),
  clusterer.average_center(True),
  clusterer.min_level(2),
])
pub fn min_cluster_size(size: Int) -> ClustererOption

Sets the minimum number of markers to form a cluster.

pub fn min_level(level: Int) -> ClustererOption

Sets the minimum zoom level at which clustering is applied.

pub fn on_cluster_click(
  id id: String,
  clusterer_id clusterer_id: String,
  handler handler: fn(coords.LatLng) -> msg,
) -> effect.Effect(msg)

Subscribes to cluster click events with the cluster center position.

pub fn on_cluster_out(
  id id: String,
  clusterer_id clusterer_id: String,
  handler handler: fn(coords.LatLng) -> msg,
) -> effect.Effect(msg)

Subscribes to cluster mouseout events.

pub fn on_cluster_over(
  id id: String,
  clusterer_id clusterer_id: String,
  handler handler: fn(coords.LatLng) -> msg,
) -> effect.Effect(msg)

Subscribes to cluster mouseover events.

pub fn on_clustered(
  id id: String,
  clusterer_id clusterer_id: String,
  handler handler: fn(Int) -> msg,
) -> effect.Effect(msg)

Subscribes to clustered events with the number of clusters.

pub fn redraw(
  id id: String,
  clusterer_id clusterer_id: String,
) -> effect.Effect(msg)

Redraws the clusterer.

pub fn remove_marker(
  id id: String,
  clusterer_id clusterer_id: String,
  marker_id marker_id: String,
) -> effect.Effect(msg)

Removes a marker from the clusterer.

pub fn set_grid_size(
  id id: String,
  clusterer_id clusterer_id: String,
  size size: Int,
) -> effect.Effect(msg)

Sets the grid size of an existing clusterer.

pub fn set_min_cluster_size(
  id id: String,
  clusterer_id clusterer_id: String,
  size size: Int,
) -> effect.Effect(msg)

Sets the minimum number of markers to form a cluster.

pub fn set_min_level(
  id id: String,
  clusterer_id clusterer_id: String,
  level level: Int,
) -> effect.Effect(msg)

Sets the minimum zoom level of an existing clusterer.

Search Document