POI Details

VERSION 0.2.3284
PUBLIC PREVIEW

Use POI details search to obtain the information about a point of interest.

To perform a call, you need to obtain a unique POI identifier and then use it to create a POIDetailsOptions.

To obtain a unique POI identifier you could use fuzzy search with resultTypeSet set to poi.

You can request POI details in different languages. See the list of supported languages.

Specify the desired response language when creating a POIDetailsOptions using a locale parameter.

If no language is specified, categories will be returned in English.

1let amsterdamCenter = CLLocationCoordinate2D(latitude: 52.377956, longitude: 4.897070)
2let poiOptions = SearchOptions(
3 query: "Restaurant",
4 geoBias: amsterdamCenter,
5 resultTypeSet: [.poi]
6)
7onlineSearch.search(options: poiOptions) { [weak onlineSearch] result in
8 switch result {
9 case let .success(poiSearchResponse):
10 let result = poiSearchResponse.results.first.flatMap { try? POIID(from: $0.id) }
11 let options = POIDetailsOptions(
12 poiID: result!,
13 locale: Locale(identifier: "en_GB")
14 )
15
16 onlineSearch?.requestPOIDetails(options: options) { result in
17 switch result {
18 case let .success(poiDetailsResponse):
19 // handle success
20 break
21 case let .failure(error):
22 // handle error
23 break
24 }
25 }
26
27 case let .failure(error):
28 // handle error
29 break
30 }
31}

As a result, you will get a POIDetailsResponse that contains SearchResult with updated poi property - SearchResult poi property

More detailed information about this service can be found in the Search API Place by ID documentation.