PredictiveCacheManager

public class PredictiveCacheManager

Proactively fetches tiles which may become necessary if the device loses its Internet connection at some point during passive or active turn-by-turn navigation.

Typically, you initialize an instance of this class and retain it as long as caching is required.

Note

This object uses global tile store configuration from NavigationSettings.tileStoreConfiguration.
  • Initializes a predictive cache. Only non-volatile styles will be cached.

    Recommended constructor. This action will initialize tile storage for navigation tiles.

    Declaration

    Swift

    public convenience init(predictiveCacheOptions: PredictiveCacheOptions,
                            cacheMapOptions: CacheMapOptions? = nil)

    Parameters

    predictiveCacheOptions

    A configuration specifying various caching parameters, such as the radii of current and destination locations.

    cacheMapOptions

    Information about MapView tiles such as the location and tilesets to cache. If this argument is set to nil, predictive caching is disabled for map tiles.

  • Initializes a predictive cache.

    It is recommended to use init(predictiveCacheOptions:cacheMapOptions:) instead to correctly specify tileset for caching of non-volatile styles .

    Declaration

    Swift

    @available(*, deprecated, message: "Use `PredictiveCacheManager.init(predictiveCacheOptions:cacheMapOptions:﹚` instead.")
    public convenience init(predictiveCacheOptions: PredictiveCacheOptions,
                            styleSourcePaths: [String])

    Parameters

    predictiveCacheOptions

    A configuration specifying various caching parameters, such as the radii of current and destination locations.

    styleSourcePaths

    Tilesets names for caching. The SDK ignores this parameter in the latest versions.

  • Initializes a predictive cache.

    It is recommended to use init(predictiveCacheOptions:cacheMapOptions:) instead to correctly specify tileset for caching of non-volatile styles .

    Declaration

    Swift

    @available(*, deprecated, message: "Use `PredictiveCacheManager.init(predictiveCacheOptions:cacheMapOptions:﹚` instead.")
    public convenience init(predictiveCacheOptions: PredictiveCacheOptions, mapOptions: MapOptions?)

    Parameters

    predictiveCacheOptions

    A configuration specifying various caching parameters, such as the radii of current and destination locations.

    mapOptions

    Information about MapView tiles such as the location and tilesets to cache. If this argument is set to nil, predictive caching is disabled for map tiles.

  • Updates a predictive cache configuration for additional tilesets. Call when new tilesets need to be cached.

    Declaration

    Swift

    public func updateMapControllers(cacheMapOptions: CacheMapOptions?)

    Parameters

    cacheMapOptions

    Information about MapView tiles such as the location and tilesets to cache.