Traffic

This is the public interface for the Traffic Data Provider in NavSDK. This interface can be passed to other components in NavSDK that work with traffic data.

Important: This is a Public Preview API. It may be changed or removed at any time.

Properties

Link copied to clipboard
abstract val isConnected: Boolean

Checks if we are currently connected to the cloud traffic provider.

Link copied to clipboard
abstract val trafficEventCount: Int

Returns the count of traffic events currently known by the client.

Functions

Link copied to clipboard

Adds a TrafficChangedListener, which reports on changes to the traffic situation.

Link copied to clipboard

Synchronously retrieves traffic events in the area specified by the provided GeoBoundingBox. If the call succeeds, returns a TrafficEventsResult. If it fails, returns a TrafficError.

abstract fun getTrafficEvents(boundingBox: GeoBoundingBox, callback: TrafficEventsCallback): Cancellable

Asynchronously retrieves traffic events in the area specified by the provided GeoBoundingBox object and returns the result in the TrafficEventsCallback.

Link copied to clipboard

Removes the previously registered TrafficChangedListener.

Link copied to clipboard
abstract fun updateLocale(locale: Locale)

Update the traffic client's Locale.

Link copied to clipboard
abstract fun updateLocationProvider(locationProvider: LocationProvider)

Set a new location provider.

Link copied to clipboard
abstract fun updateRoutesForTraffic(routes: List<List<GeoPoint>>)

Update the list of routes for which the client is interested in receiving traffic along the route. Providing an empty list disables traffic along the route. It can be enabled again by providing new routes via this method.

Inherited functions

Link copied to clipboard
abstract fun close()