lustre_kakaomap/rectangle
Rectangle shape for KakaoMap. Supports pipeline-friendly API:
let bounds = coords.lat_lng_bounds(sw: coords.seoul(), ne: coords.busan())
rectangle.from(bounds)
|> rectangle.color("#00FF00")
|> rectangle.fill(color: "#88FF88", opacity: 0.3)
|> rectangle.draw(id: "map", shape_id: "region")
Types
pub opaque type RectangleOption
Values
pub fn bounds(b: coords.LatLngBounds) -> RectangleOption
Sets the rectangle bounds. Required.
pub fn color(
options: List(RectangleOption),
color: String,
) -> List(RectangleOption)
Adds stroke color (pipeline-friendly).
pub fn draw(
options options: List(RectangleOption),
id id: String,
shape_id shape_id: String,
) -> effect.Effect(msg)
Draws a rectangle on the map.
pub fn fill(
options: List(RectangleOption),
color color: String,
opacity opacity: Float,
) -> List(RectangleOption)
Adds fill color and opacity (pipeline-friendly).
pub fn fill_color(color: String) -> RectangleOption
Sets fill color as “#xxxxxx” hex string.
pub fn fill_opacity(opacity: Float) -> RectangleOption
Sets fill opacity (0.0 to 1.0).
pub fn from(b: coords.LatLngBounds) -> List(RectangleOption)
Creates an option list from bounds. Pipeline entry point.
let bounds = coords.lat_lng_bounds(sw: coords.seoul(), ne: coords.busan())
rectangle.from(bounds)
|> rectangle.color("#00FF00")
|> rectangle.fill(color: "#88FF88", opacity: 0.3)
|> rectangle.draw(id: "map", shape_id: "region")
pub fn remove(
id id: String,
shape_id shape_id: String,
) -> effect.Effect(msg)
Removes a rectangle from the map.
pub fn set_bounds(
id id: String,
shape_id shape_id: String,
b b: coords.LatLngBounds,
) -> effect.Effect(msg)
Updates the rectangle bounds.
pub fn stroke_color(color: String) -> RectangleOption
Sets stroke color as “#xxxxxx” hex string.
pub fn stroke_opacity(opacity: Float) -> RectangleOption
Sets stroke opacity (0.0 to 1.0).
pub fn stroke_style(style: types.StrokeStyle) -> RectangleOption
Sets stroke style.