lustre_kakaomap/roadview

Roadview (street view) for KakaoMap.

Provides roadview initialization, viewpoint control, panorama navigation, and roadview overlay on maps. All operations are Lustre Effects.

Types

Options for roadview initialization.

pub opaque type RoadviewOption

A roadview viewpoint with pan, tilt, and zoom values.

pub opaque type Viewpoint

Values

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

Destroys the roadview instance and cleans up resources.

pub fn get_nearest_pano_id(
  position pos: coords.LatLng,
  radius radius: Float,
  handler handler: fn(Int) -> msg,
) -> effect.Effect(msg)

Finds the nearest panorama ID to a position within a given radius.

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

Gets the current panorama ID.

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

Gets the current roadview position.

pub fn get_viewpoint_state(
  id id: String,
  handler handler: fn(Viewpoint) -> msg,
) -> effect.Effect(msg)

Gets the current viewpoint (pan, tilt, zoom).

pub fn hide_overlay(map_id map_id: String) -> effect.Effect(msg)

Hides roadview road lines from the given map.

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

Initializes a roadview instance on the container with the given id.

roadview.init(id: "rv", options: [
  roadview.pano_id(1023434522),
  roadview.init_pan(120.0),
])
pub fn init_pan(value: Float) -> RoadviewOption

Sets the initial pan angle.

pub fn init_tilt(value: Float) -> RoadviewOption

Sets the initial tilt angle.

pub fn init_zoom(level: Int) -> RoadviewOption

Sets the initial zoom level.

pub fn on_init(
  id id: String,
  handler handler: fn() -> msg,
) -> effect.Effect(msg)

Subscribes to roadview init events.

pub fn on_panoid_changed(
  id id: String,
  handler handler: fn() -> msg,
) -> effect.Effect(msg)

Subscribes to panorama ID change events.

pub fn on_position_changed(
  id id: String,
  handler handler: fn() -> msg,
) -> effect.Effect(msg)

Subscribes to position change events.

pub fn on_viewpoint_changed(
  id id: String,
  handler handler: fn() -> msg,
) -> effect.Effect(msg)

Subscribes to viewpoint change events.

pub fn pan(vp: Viewpoint) -> Float

Returns the pan value of a viewpoint.

pub fn pano_id(id: Int) -> RoadviewOption

Sets the initial panorama ID.

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

Triggers a roadview relayout (call after container resize).

pub fn roadview_view(
  id id: String,
  attributes attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)

Renders the roadview container div element.

roadview.roadview_view(id: "rv", attributes: [
  attribute.style([#("width", "100%"), #("height", "400px")]),
])
pub fn set_pano_id(
  id id: String,
  pano_id pid: Int,
  position pos: coords.LatLng,
) -> effect.Effect(msg)

Sets the panorama ID and moves to the given position.

pub fn set_viewpoint(
  id id: String,
  vp vp: Viewpoint,
) -> effect.Effect(msg)

Sets the roadview viewpoint (pan, tilt, zoom).

pub fn show_overlay(map_id map_id: String) -> effect.Effect(msg)

Shows roadview road lines on the given map.

pub fn tilt(vp: Viewpoint) -> Float

Returns the tilt value of a viewpoint.

pub fn viewpoint(
  pan pan: Float,
  tilt tilt: Float,
  zoom zoom: Int,
) -> Viewpoint

Creates a Viewpoint from pan, tilt, and zoom values.

pub fn zoom(vp: Viewpoint) -> Int

Returns the zoom value of a viewpoint.

Search Document