TTRouteManager

Objective-C

@protocol TTRouteManager <NSObject>

Swift

protocol TTRouteManager : NSObjectProtocol

TTRouteManager class to manage interactions with drawing routes on map.

  • Array of route that are present on the map

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSArray<TTMapRoute *> *_Nonnull routes;

    Swift

    var routes: [TTMapRoute] { get }
  • Draws new route on the map

    Declaration

    Objective-C

    - (void)addRoute:(TTMapRoute *_Nonnull)route;

    Swift

    func add(_ route: TTMapRoute)

    Parameters

    route

    route TTMapRoute

  • Removes given route from map. Throws exception if route was not added to map before.

    Declaration

    Objective-C

    - (void)removeRoute:(TTMapRoute *_Nonnull)route;

    Swift

    func remove(_ route: TTMapRoute)

    Parameters

    route

    route TTMapRoute

  • Allows to change style for given route.

    Declaration

    Objective-C

    - (void)updateRoute:(TTMapRoute *_Nonnull)route
                  style:(TTMapRouteStyle *_Nonnull)style;

    Swift

    func update(_ route: TTMapRoute, style: TTMapRouteStyle)

    Parameters

    route

    TTMapRoute

    style

    TTMapRouteStyle

  • Changes z-index of route to present it on top of others. Crashes when route is not attached to map.

    Declaration

    Objective-C

    - (void)bringToFrontRoute:(TTMapRoute *_Nonnull)route;

    Swift

    func bring(toFrontRoute route: TTMapRoute)

    Parameters

    route

    TTMapRoute

  • Removes all route from the map

    Declaration

    Objective-C

    - (void)removeAllRoutes;

    Swift

    func removeAllRoutes()
  • Finds best zoom level and bounding box to present given route. Throws exception if route was not added to map before.

    Declaration

    Objective-C

    - (void)showRouteOverview:(TTMapRoute *_Nonnull)route;

    Swift

    func showRouteOverview(_ route: TTMapRoute)

    Parameters

    route

    route TTMapRoute

  • Finds best zoom level and bounding box to present all routes that are added to map.

    Declaration

    Objective-C

    - (void)showAllRoutesOverview;

    Swift

    func showAllRoutesOverview()