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
-
MartMT1 - Large mart (대형마트)
-
ConvStoreCS2 - Convenience store (편의점)
-
SchoolSC4 - School (학교)
-
AcademyAC5 - Academy (학원)
-
ParkingPK6 - Parking (주차장)
-
GasStationOL7 - Gas station / charging (주유소/충전소)
-
SubwaySW8 - Subway station (지하철역)
-
BankBK9 - Bank (은행)
-
CultureCT1 - Cultural facility (문화시설)
-
BrokerageAG2 - Real estate agency (중개업소)
-
PublicInstPO3 - Public institution (공공기관)
-
AttractionAT4 - Tourist attraction (관광명소)
-
LodgeAD5 - Accommodation (숙박)
-
RestaurantFD6 - Restaurant (음식점)
-
CafeCE7 - Cafe (카페)
-
HospitalHP8 - Hospital (병원)
-
PharmacyPM9 - 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 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_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 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 location(pos: coords.LatLng) -> SearchOption
Sets the center location for the search.
pub fn position(result: PlaceResult) -> coords.LatLng
Returns the position as a LatLng.
pub fn road_address_name(result: PlaceResult) -> String
Returns the road address name.