Free driving

VERSION 0.2.2822
PUBLIC PREVIEW

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

When you use navigation without a specified route, it’s called free driving. Free driving provides detailed information about the current location such as speed, speed limit, country code, street name, road characteristics, and so on.

At any time, you can switch from free driving mode to turn-by-turn navigation using the Navigation.update(routePlan: RoutePlan) method. You can learn 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. Learn 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 has no effect.

navigation.stop()

Current location context updates

To get current location context updates, set up a NavigationLocationContextObserver::func didDetectLocationContext(locationContext: LocationContext) callback. More details about location context can be found in the location context guide.

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

Next steps

Since you have learned about free driving, here are recommendations for the next steps: