requestPoiCategories
open override fun requestPoiCategories(options: PoiCategoryOptions): Result<PoiCategoryResponse, SearchFailure>
Synchronously provides a full list of POI categories and subcategories together with their translations and synonyms.
Return
The Result containing a PoiCategoryResponse if the call succeeds, or a SearchFailure if it fails.
Example of a POI category request:
val poiCategoryOptions = PoiCategoryOptions(
categories = setOf(CategoryId(standard = StandardCategoryId.Restaurant)),
locale = Locale.US
)
val response = search.requestPoiCategories(poiCategoryOptions)
if (response.isSuccess()) {
val result: PoiCategoryResponse = response.value()
Log.d("tag", "POI categories: ${result.poiCategories}")
} else {
val failure: SearchFailure = response.failure()
Log.e("tag", failure.message)
}
Content copied to clipboard
Parameters
options
The object containing the properties to fetch POI category details.
open override fun requestPoiCategories(options: PoiCategoryOptions, callback: PoiCategoryCallback): Cancellable
Asynchronously provides a complete list of POI categories and subcategories with their translations and synonyms.
Return
A cancellable operation.
Example of a POI category request:
val poiCategoryOptions = PoiCategoryOptions(
categories = setOf(CategoryId(standard = StandardCategoryId.Restaurant)),
locale = Locale.US
)
val response = search.requestPoiCategories(poiCategoryOptions, object : PoiCategoryCallback {
override fun onSuccess(result: PoiCategoryResponse) {
Log.d("tag", "POI categories: ${result.poiCategories}")
}
override fun onFailure(failure: SearchFailure) {
Log.e("tag", failure.message)
}
})
Content copied to clipboard
Parameters
options
The object containing the properties to fetch POI category details.
callback
The PoiCategoryCallback invoked when the fetch operation has finished, either successfully or with an error. The callback is executed on the main thread.