Bring your own data

VERSION 1.20.1
PUBLIC PREVIEW

Custom POIs are points of interest that are specific to the application. The TomTom 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.20.1")

Note that the custom POI functionality requires access to the Offline functionality.

Offline functionality for the Maps SDK and Navigation SDK for Android is only available upon request. Contact us to get started.

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

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

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

Next steps

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