Sorry, you need to enable JavaScript to visit this website.

Route alternatives

Route alternatives

Allow your users to check different routing alternatives so they can choose the one they prefer.

Sample use case: You are preparing a road trip and you would like to see different route options
so you can choose one that is both optimal for your trip and suits your road trip preferences.

In the example below, you can see an implementation of alternative routes using a clickable route object.
Click on the route to get its ETA and the distance between its origin and destination.

_

let mapRoute = TTMapRoute(coordinatesData: planedRoute,
                          with: TTMapRouteStyle.defaultActive(),
                          imageStart: TTMapRoute.defaultImageDeparture(),
                          imageEnd: TTMapRoute.defaultImageDestination())
mapView.routeManager.add(mapRoute)
mapRoute.extraData = planedRoute.summary
TTMapRoute *mapRoute = [TTMapRoute
    routeWithCoordinatesData:planedRoute
              withRouteStyle:TTMapRouteStyle.defaultActiveStyle
                  imageStart:TTMapRoute.defaultImageDeparture
                    imageEnd:TTMapRoute.defaultImageDestination];
[self.mapView.routeManager addRoute:mapRoute];
mapRoute.extraData = planedRoute.summary;

 

You are here