Bring your own data

VERSION 1.1.0
PUBLIC PREVIEW

Custom POIs are points of interest that are specific to the application. TomTom’s Search modules offer the functionality to create and incorporate custom POIs into the search process, allowing them to be utilized alongside the existing pool of available POIs.

To use custom POIs, add the following module dependency in the build.gradle.kts of your application module and synchronize the project.

implementation("com.tomtom.sdk.search:search-custom-data-online:1.1.0")

Note that by making use of the custom POI functionality the binary size of search-client-custom-data-online is increased.

Add the following import to your Kotlin file

import com.tomtom.sdk.search.online.custompoi.create

Then create a list of CustomPOIs and add them to the provider.

1val customPOIs = setOf(
2 CustomPoi(
3 id = "custom-1",
4 place = Place(
5 coordinate = GeoPoint(latitude = 52.12, longitude = 4.8),
6 address = Address(
7 streetName = "Toccatastraat",
8 streetNumber = "14",
9 countryCodeIso3 = "NLD",
10 municipality = "Almere"
11 ),
12 entryPoints = listOf(
13 EntryPoint(
14 EntryType.Main,
15 GeoPoint(latitude = 52.121, longitude = 4.81)
16 )
17 )
18 ),
19 poi = Poi(
20 names = setOf("custom poi 1")
21 )
22 )
23)
24
25customPoiDataProvider.setCustomPois(customPOIs)

And finally, initialize TomTom’s Online Search module with the newly created custom POI provider

1val searchApiWithCustomDataProvider = OnlineSearch.create(
2 context,
3 "YOUR_API_KEY",
4 listOf(customPoiDataProvider)
5)

Next steps

Since you have learned how to work with custom POI details, here are recommendations for the next steps: