lustre_kakaomap/marker

Marker overlay for KakaoMap.

Types

Options for creating a marker.

pub opaque type MarkerOption

Values

pub fn add(
  id id: String,
  marker_id marker_id: String,
  options options: List(MarkerOption),
) -> effect.Effect(msg)

Adds a marker to the map.

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

Removes all markers from the map.

pub fn clickable(enabled: Bool) -> MarkerOption

Sets whether the marker is clickable.

pub fn draggable(enabled: Bool) -> MarkerOption

Sets whether the marker is draggable.

pub fn image(
  src src: String,
  size s: coords.Size,
) -> MarkerOption

Sets a custom marker image.

pub fn image_with_offset(
  src src: String,
  size s: coords.Size,
  offset o: coords.Point,
) -> MarkerOption

Sets a custom marker image with anchor offset.

pub fn opacity(value: Float) -> MarkerOption

Sets the marker opacity (0.0 to 1.0).

pub fn position(pos: coords.LatLng) -> MarkerOption

Sets the marker position. Required.

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

Removes a marker from the map.

pub fn set_draggable(
  id id: String,
  marker_id marker_id: String,
  enabled enabled: Bool,
) -> effect.Effect(msg)

Sets the draggable state of a marker.

pub fn set_opacity(
  id id: String,
  marker_id marker_id: String,
  value value: Float,
) -> effect.Effect(msg)

Sets the opacity of a marker.

pub fn set_position(
  id id: String,
  marker_id marker_id: String,
  pos pos: coords.LatLng,
) -> effect.Effect(msg)

Updates the position of an existing marker.

pub fn set_title(
  id id: String,
  marker_id marker_id: String,
  text text: String,
) -> effect.Effect(msg)

Sets the title of a marker.

pub fn set_visible(
  id id: String,
  marker_id marker_id: String,
  visible visible: Bool,
) -> effect.Effect(msg)

Sets the visibility of a marker.

pub fn sync(
  id id: String,
  markers markers: List(#(String, coords.LatLng, String)),
) -> effect.Effect(msg)

Synchronizes markers on the map with a desired list. Adds new markers, removes missing ones, and updates changed positions/titles.

marker.sync(id: "mymap", markers: [
  #("m1", coords.seoul(), "Seoul"),
  #("m2", coords.busan(), "Busan"),
])
pub fn title(text: String) -> MarkerOption

Sets the marker tooltip title.

pub fn z_index(index: Int) -> MarkerOption

Sets the marker z-index.

Search Document