OfflineRangeCalculator

public final class OfflineRangeCalculator : RangeCalculator

This offline service calculates the area that can be reached from the origin point.

Important

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

Lifecycle

  • Creates a new OfflineRangeCalculator instance with the given parameters.

    Throws

    An error if either NDSStore is invalid or an instance of RangeCalculator cannot be created.

    Important

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

    Declaration

    Swift

    public init(
        store: NDSStore,
        trafficService: TrafficService? = nil
    ) throws

    Parameters

    store

    An NDSStore providing access to the offline map.

    trafficService

    Provider of Traffic Events to be taken into account in range calculation.

Public

  • Defines the error cases that can occur while calculating range.

    Important

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

    Declaration

    Swift

    public enum RangeError : Error
  • Calculates the area that can be reached from the origin point.

    Important

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

    Declaration

    Swift

    public func calculateRange(
        options: TomTomSDKRoutePlanner.RangeCalculationOptions,
        completion: @escaping (Result<TomTomSDKRoutePlanner.Range, Error>) -> ()
    )

    Parameters

    options
    completion

    The completion closure is called after the response to the request has been processed. If no errors have occurred, ReachableRangeResponse contains the range polygons and the precise polygon center (the result of map-matching the origin point).

  • Cancels all current requests.

    Important

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

    Declaration

    Swift

    public func cancelPendingRequests()