lustre_kakaomap/services/places

Place search service for KakaoMap.

Provides keyword and category-based place searches using the KakaoMap Services API. Requires &libraries=services in the SDK script tag.

// Keyword search
places.keyword_search(keyword: "cafe", options: [
  places.location(coords.seoul()),
  places.radius(1000),
  places.sort(status.Distance),
], handler: GotPlaces)

// Category search with type-safe category code
places.category_search_by(
  category: places.Cafe,
  options: [places.location(coords.gangnam())],
  handler: GotCafes,
)

Types

Category codes for KakaoMap place search. Use with category_search_by for type-safe category filtering.

pub type CategoryCode {
  Mart
  ConvStore
  School
  Academy
  Parking
  GasStation
  Subway
  Bank
  Culture
  Brokerage
  PublicInst
  Attraction
  Lodge
  Restaurant
  Cafe
  Hospital
  Pharmacy
}

Constructors

  • Mart

    MT1 - Large mart (대형마트)

  • ConvStore

    CS2 - Convenience store (편의점)

  • School

    SC4 - School (학교)

  • Academy

    AC5 - Academy (학원)

  • Parking

    PK6 - Parking (주차장)

  • GasStation

    OL7 - Gas station / charging (주유소/충전소)

  • Subway

    SW8 - Subway station (지하철역)

  • Bank

    BK9 - Bank (은행)

  • Culture

    CT1 - Cultural facility (문화시설)

  • Brokerage

    AG2 - Real estate agency (중개업소)

  • PublicInst

    PO3 - Public institution (공공기관)

  • Attraction

    AT4 - Tourist attraction (관광명소)

  • Lodge

    AD5 - Accommodation (숙박)

  • Restaurant

    FD6 - Restaurant (음식점)

  • Cafe

    CE7 - Cafe (카페)

  • Hospital

    HP8 - Hospital (병원)

  • Pharmacy

    PM9 - Pharmacy (약국)

A single place result from a keyword or category search.

pub opaque type PlaceResult

Options for place search requests.

pub opaque type SearchOption

Values

pub fn address_name(result: PlaceResult) -> String

Returns the address name.

pub fn category(code: CategoryCode) -> SearchOption

Sets the category group code filter (type-safe).

places.keyword_search(keyword: "food", options: [
  places.category(places.Restaurant),
], handler: GotPlaces)
pub fn category_code_to_string(code: CategoryCode) -> String

Converts a CategoryCode to its KakaoMap API string.

pub fn category_group_code(code: String) -> SearchOption

Sets the category group code filter (raw string).

pub fn category_name(result: PlaceResult) -> String

Returns the category name.

pub fn category_search(
  code code: String,
  options options: List(SearchOption),
  handler handler: fn(status.SearchStatus, List(PlaceResult)) -> msg,
) -> effect.Effect(msg)

Searches for places by category (raw string code).

pub fn category_search_by(
  category category: CategoryCode,
  options options: List(SearchOption),
  handler handler: fn(status.SearchStatus, List(PlaceResult)) -> msg,
) -> effect.Effect(msg)

Searches for places by category (type-safe).

places.category_search_by(
  category: places.Cafe,
  options: [places.location(coords.seoul()), places.radius(1000)],
  handler: GotCafes,
)
pub fn id(result: PlaceResult) -> String

Returns the place ID.

pub fn keyword_search(
  keyword keyword: String,
  options options: List(SearchOption),
  handler handler: fn(status.SearchStatus, List(PlaceResult)) -> msg,
) -> effect.Effect(msg)

Searches for places by keyword.

pub fn lat(result: PlaceResult) -> Float

Returns the latitude.

pub fn lng(result: PlaceResult) -> Float

Returns the longitude.

pub fn location(pos: coords.LatLng) -> SearchOption

Sets the center location for the search.

pub fn page(num: Int) -> SearchOption

Sets the page number.

pub fn phone(result: PlaceResult) -> String

Returns the phone number.

pub fn place_name(result: PlaceResult) -> String

Returns the place name.

pub fn place_url(result: PlaceResult) -> String

Returns the place URL.

pub fn position(result: PlaceResult) -> coords.LatLng

Returns the position as a LatLng.

pub fn radius(meters: Int) -> SearchOption

Sets the search radius in meters.

pub fn road_address_name(result: PlaceResult) -> String

Returns the road address name.

pub fn size(count: Int) -> SearchOption

Sets the number of results per page.

pub fn sort(by: status.SortBy) -> SearchOption

Sets the sort order for results.

Search Document