RouteActions
public protocol RouteActions
Protocol allowing management of the route representation on the map.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Method to add a route on the map.
Throws
LayerServiceError.failedToCreateAnnotationLayerif it fails to create a given route layer.Example:
let routeOption: RouteOptions = RouteOptions(coordinates: route.geometry) guard let mapRoute = try? self.tomtomMapView.map.addRoute(routeOption) else { return }Declaration
Swift
func addRoute(_ options: RouteOptions) throws -> RouteParameters
optionsobject
RouteOptionsReturn Value
Routeobject used for further manipulation. -
Method to remove all routes from the map.
Declaration
Swift
func removeRoutes() -
Method to zoom and center to all routes currently visible on the map, including padding.
Declaration
Swift
func zoomToRoutes(padding: UInt)Parameters
paddingPadding from the edges of the map.
-
Method to access all visible routes on the map.
Declaration
Swift
var routesAll: [Route] { get }
RouteActions Protocol Reference