Free driving

VERSION 0.2.1455
PUBLIC PREVIEW

The Navigation SDK for iOS is only available upon request. Contact us to get started.

Free driving is navigation without a route. It provides detailed information about the current location such as speed, speed limit, country code, street name, road characteristics, etc.

At any time, you can switch from free driving mode to turn-by-turn navigation using the Navigation.update(routePlan: RoutePlan) method. Read more about updating the Route in the Update route guide.

Start navigation

First, add the navigation module to your project and set up a Navigation object. Read how to do this in the Quickstart guide.

Once Navigation is initialized, you can start navigation using the Navigation.start() method.

navigation.start()

Stop navigation

To stop any currently running navigation use the Navigation.stop() method. This method also clears all data related to navigation. If navigation has not been started, the stop method will have no effect.

navigation.stop()

Current location context updates

To get current location context updates, set up a TomTomNavigationDelegate::tomTomNavigation(_: Navigation, didDetectLocationContext context: LocationContext) callback. More details about location context can be found in the location context guide.

1func tomTomNavigation(_: Navigation, didDetectLocationContext context: LocationContext) {
2 let speed: Measurement<UnitSpeed> = context.speed
3 let speedLimit: SpeedLimit? = context.speedLimit
4
5 let countryCode: String = context.address.countryCode
6 let city: String = context.address.city
7 let streetName: String = context.address.steetName
8
9 let functionalRoadClass: Int? = context.road?.functionalRoadClass
10 let isRoadTunnel: Bool? = context.road?.isTunnel
11 let isRoadUnderpass: Bool? = context.road?.isUnderpass
12}

center