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
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 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 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 viewpoint(
pan pan: Float,
tilt tilt: Float,
zoom zoom: Int,
) -> Viewpoint
Creates a Viewpoint from pan, tilt, and zoom values.