Enable wayfinding

There are several wayfinding-specific classes you should use when enabling wayfinding that extend the functionality of base classes:

If you want the waypath to be rendered on your map view, you’ll have to create a VMVectorWalkingPathOverlay and add it to your mapview:

//Create a `VMVectorWalkingPathOverlay` object, which will handle interacting
//with the map to select start/endpoint locations for wayfinding
self.walkingPathOverlay = VMVectorWalkingPathOverlay(map: mapView)
self.walkingPathOverlay?.map = self.vmd
self.walkingPathOverlay?.delegate = self
.. and so on

Key Methods

There are two key method to to use when wayfinding.

Finding waypath between two locations

The first one will take your instance of a VMWayfindingMap and find a path between a given start and end waypoint.

var vmd = VMWayfindingMap() //this should be created by the parsing the VMWayfindingVMDParser

vmd.findWaypathBetweenWaypointsStart(start, end: end, with: VMMSWayfindingOptions(elevatorsEnabled: true, andStairsEnabled: true), delegate: self)

Implement the VMMSWayfindingDelegate protocol to get notified of any callbacks from the SDK for wayfinding.

/// Called when wayfinding path is found
/// - Parameter waypath: the Waypath that leads from the starting point to the ending point
func didFinishFinding(_ waypath: VMMSWaypath)

Convert a waypath to text directions

The second key method for wayinding is to take an instance of a VMMSWaypath that describes the path from a given start point to a end point and convert that into human-readable directions.

var vmd = VMWayfindingMap() //this should be created by the parsing the VMWayfindingVMDParser
...
var options = VMMSTurnByTurnDirectionOptions()
vmd.createTurnByTurnDirections(for: waypath, with: nil, andOptions: options, delegate: self)

Similar to implementing the VMMSWayfindingDelegate protocol for getting notified when a waypath is found, you also need to do the same to receive the callback when a waypath has been converted to turn by turn directions.

func didFinishCreatingTurn(byTurnDirections directions: [VMMSMapDirectionStep])