lustre_kakaomap/url

KakaoMap URL builder — pure functions, no FFI required.

Generates URLs for KakaoMap links: map view, route finding, roadview, and search. These URLs work on both PC and mobile.

Types

A named location with coordinates, used in route building.

pub opaque type NamedLocation

Subway region for subway route URLs.

pub type SubwayRegion {
  SeoulSubway
  BusanSubway
  DaeguSubway
  GwangjuSubway
  DaejeonSubway
}

Constructors

  • SeoulSubway
  • BusanSubway
  • DaeguSubway
  • GwangjuSubway
  • DaejeonSubway

Transport mode for route URLs.

pub type TransportMode {
  Car
  Transit
  Walk
  Bicycle
}

Constructors

  • Car
  • Transit
  • Walk
  • Bicycle

Values

pub fn map_link(position: coords.LatLng) -> String

Generates a map link URL showing a specific coordinate.

url.map_link(coords.seoul())
// -> "https://map.kakao.com/link/map/37.5665,126.978"
pub fn map_link_by_id(place_id place_id: String) -> String

Generates a map link URL by place ID.

pub fn map_link_named(
  name name: String,
  position position: coords.LatLng,
) -> String

Generates a named map link URL.

url.map_link_named(name: "서울시청", position: coords.seoul())
// -> "https://map.kakao.com/link/map/서울시청,37.5665,126.978"
pub fn named_location(
  name name: String,
  position position: coords.LatLng,
) -> NamedLocation

Creates a named location for URL building.

pub fn roadview(position: coords.LatLng) -> String

Generates a roadview URL for a coordinate.

pub fn roadview_by_id(place_id place_id: String) -> String

Generates a roadview URL by place ID.

pub fn route_by(
  mode mode: TransportMode,
  from from: NamedLocation,
  to to: NamedLocation,
) -> String

Generates a route URL with transport mode.

let from = url.named_location(name: "서울역", position: coords.seoul())
let to = url.named_location(name: "부산역", position: coords.busan())
url.route_by(mode: url.Car, from:, to:)
pub fn route_by_via(
  mode mode: TransportMode,
  from from: NamedLocation,
  via via: List(NamedLocation),
  to to: NamedLocation,
) -> String

Generates a route URL with transport mode and waypoints (max 5). Transit mode does not support waypoints.

pub fn route_from_to(
  from from: NamedLocation,
  to to: NamedLocation,
) -> String

Generates a route URL with origin and destination.

pub fn route_to(destination: NamedLocation) -> String

Generates a destination-only route URL.

let dest = url.named_location(name: "카카오", position: coords.pangyo())
url.route_to(dest)
pub fn search(query query: String) -> String

Generates a search results URL.

url.search(query: "카카오")
// -> "https://map.kakao.com/link/search/카카오"
pub fn subway_route(
  region region: SubwayRegion,
  from from: String,
  to to: String,
) -> String

Generates a subway route URL.

url.subway_route(region: url.SeoulSubway, from: "판교역", to: "강남역")
Search Document