Discover
The discover package provides class libraries which enable developers to build discovery orientated features for categories and brands. The following discover features are available.
- Get Categories - Provides access to category hierarchy.
- Discover Category - Discover which POI categories exist around a provided location.
- Discover Brand - Discover which POI brands exist around a provided location
- Discover Place - Discover places for the specified category.
Please see the API reference for the main classes related to Discover.
Get Categories
The get categories feature provides the developer access to the full category hierarchy. Use this method to retrieve available categories including their ids and level in hierarchy. This feature can be used to build a hierarchical interface for the application or just as a tool to acquire the full Telenav hierarchy. Since this method does not have any spatial context the developer does not need to set a location nor provide other input parameters.
Key methods
Method | Details |
---|---|
getCategories() | Returns categories. |
Sample code
1 2 3 4 5 6 |
|
1 2 3 |
|
Discover Category
Note
This is a beta version of the API.
The discover category feature enables discovery of categories around a specific location. Developers can build powerful discovery experiences which enable the end user to explore and determine if desired POI categories such as coffee shops, restaurants, shopping, etc. are around a provided location. Use the optional setCategory method with a parent category id to limit the discovery to child categories of that parent. For example; providing the parent id for ‘restaurants’ will enable discovery of all cuisine type categories.
Key methods
Method | Details |
---|---|
categoryId(categoryId: String) | A string value of category id returned by Get Categories API, optional. |
location(location: TNEntityGeoPoint) | A geopoint value of the user’s location using geographic coordinates of latitude and longitude. |
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 |
|
1 2 3 4 5 6 7 8 9 10 |
|
Discover Brand
Note
This is a beta version of the API.
The discover brand feature enables discovery of brands around a specific location. Powerful discovery experiences can be built enabling the end user to discover popular brands around a provided location. Use optional categoryId
with an applicable category id to limit the brands returned to brands belonging to the specific category. For example, if the use case is for restaurant brands then set the category to restaurants.
Key methods
Method | Details |
---|---|
categoryId(categoryId: String) | A string value of category id returned by Get Categories API, optional. |
location(location: TNEntityGeoPoint) | A geopoint value of the user’s location using geographic coordinates of latitude and longitude. |
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 |
|
1 2 3 4 5 6 7 8 9 10 |
|
Discover Place
Discover places for the specified category. Following are the Discover Place features.
-
Lite Result - When set to true, only basic POI attributes are returned with support for returning up to 1000 results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
- entity id - entity type - place - name - categories[] - address[] - geo_coordinates - facets - ev_connectors // only ev_connector facet will be returned in response with limited EV attributes - total_connector - connector_counts - connectors[] - connector_type - power_feed_level - charger_brand - connector_number - available - max_power - is_free
-
Polygon filter - Constrains the discover results to any polygon shape.
- Bounding box filter - Constrains the discover results to a rectangular bounding box.
- Radius filter - Constrains the discover results to a circle of a specified radius.
- Electric vehicle charge station search - Specialized search service for electric vehicle charge stations.
Key methods
Method | Details |
---|---|
location(_ lat: Double, _ lon: Double) | A geopoint value of the user’s location using geographic coordinates of latitude and longitude separated by comma. For example, location=37.1245,-122.45678. |
categories(_ categoryes: [String]) | Set discover category IDs |
liteResult(_ liteResult: Bool) | When set to true only basic poi attributes will be returned with support for returning up to 1000 results. The default value is True |
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Polygon Filter
Key methods
Method | Details |
---|---|
polygonGeoFilter(_ polygonPoints: [TNEntityGeoPoint]) | The polygon geofilter created above |
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
Bounding Box Filter
Key methods
Method | Details |
---|---|
bboxGeoFilter(bottomLeft: TNEntityGeoPoint, topRight: TNEntityGeoPoint) | The bbox geofilter created above |
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Radius Filter
Key methods
Method | Details |
---|---|
radiusGeoFilter(_ radiusInMeter: Double) | The radius geofilter created above |
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
EV Filter
Similar to the EvFilter
in the Search
API, refer Search Doc
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|