PredictiveCacheController

fun PredictiveCacheController(predictiveCacheOptions: PredictiveCacheOptions)

Constructs a new instance of the PredictiveCacheController using the provided PredictiveCacheOptions. Throws IllegalStateException if MapboxNavigation was not instantiated before. Use PredictiveCacheController constructor which explicitly accepts MapboxNavigation instance.

Parameters

predictiveCacheOptions

PredictiveCacheOptions options to instantiate instance of PredictiveCacheController

Throws

if MapboxNavigation was not instantiated before


fun PredictiveCacheController(mapboxNavigation: MapboxNavigation, predictiveCacheOptions: PredictiveCacheOptions)

Constructs a new instance of the PredictiveCacheController using the provided MapboxNavigation and PredictiveCacheOptions.

Note: The lifecycle of the MapboxNavigation instance should be longer than that of the PredictiveCacheController. Specifically, MapboxNavigation should not be destroyed before PredictiveCacheController.onDestroy is called.

Parameters

mapboxNavigation

MapboxNavigation object which will be used as a source of active route

predictiveCacheOptions

PredictiveCacheOptions options to instantiate instance of PredictiveCacheController


fun PredictiveCacheController(predictiveCacheLocationOptions: PredictiveCacheLocationOptions = PredictiveCacheLocationOptions.Builder().build(), predictiveCacheControllerErrorHandler: PredictiveCacheControllerErrorHandler? = null)

Constructs a new instance of the PredictiveCacheController using the provided options. Throws IllegalStateException if MapboxNavigation was not instantiated before. Use PredictiveCacheController constructor which explicitly accepts MapboxNavigation instance and predictiveCacheControllerErrorHandler instead.

Parameters

predictiveCacheLocationOptions

PredictiveCacheLocationOptions location configuration for visual map predictive caching (optional)

predictiveCacheControllerErrorHandler

PredictiveCacheControllerErrorHandler listener (optional) Noting that predictiveCacheLocationOptions is used as predictiveCacheGuidanceLocationOptions when constructing PredictiveCacheController to retain backwards compatibility

Throws

if MapboxNavigation was not instantiated before


fun PredictiveCacheController(    predictiveCacheLocationOptions: PredictiveCacheLocationOptions = PredictiveCacheLocationOptions.Builder().build(),     predictiveCacheGuidanceLocationOptions: PredictiveCacheLocationOptions = PredictiveCacheLocationOptions.Builder().build(),     predictiveCacheControllerErrorHandler: PredictiveCacheControllerErrorHandler? = null)

Constructs a new instance of the PredictiveCacheController using the provided options. Throws IllegalStateException if MapboxNavigation was not instantiated before. Use PredictiveCacheController constructor which explicitly accepts MapboxNavigation instance and predictiveCacheControllerErrorHandler instead.

Parameters

predictiveCacheLocationOptions

PredictiveCacheLocationOptions location configuration for visual map predictive caching (optional)

predictiveCacheGuidanceLocationOptions

PredictiveCacheLocationOptions location configuration for guidance predictive caching (optional)

predictiveCacheControllerErrorHandler

Throws

if MapboxNavigation was not instantiated before