Set route on a map using Indoo.rs ios sdk
<p>I am using Indoo.rs ios sdk by swift to build a small app showing my map, the issue is I have no idea to write a code to set route between 2 point on the map, I came across the documentation but no result ... here is my code :</p>

<p>The documentation is here : <a href="https://indoors.readme.io/docs/routing-1" rel="nofollow">https://indoors.readme.io/docs/routing-1</a></p>

<p>Please if there is any idea share with me.
Thanks</p>

<pre><code>import UIKit

import CoreLocation

class ViewController: UIViewController , RoutingDelegate ,IndoorsServiceDelegate, ISIndoorsSurfaceViewControllerDelegate ,IndoorsSurfaceViewDelegate {

    @IBOutlet var SetRouteButton: UIButton!

    var _currentBuilding: IDSBuilding?
    var dot  : ISIndoorsSurface?
    var _indoorsSurfaceViewController: ISIndoorsSurfaceViewController?

    override func viewDidLoad() {
        super.viewDidLoad()


        // API key of the cloud application
        _ = Indoors(licenseKey: "My_API_KEY" , andServiceDelegate: nil)
        _indoorsSurfaceViewController = ISIndoorsSurfaceViewController()
        _indoorsSurfaceViewController!.delegate = self


        // Enabling dotOnRail Mode
        _indoorsSurfaceViewController!.surfaceView.dotOnRailsJumpingDistance = 55000
        _indoorsSurfaceViewController!.surfaceView.enableDotOnRails = true


        // show currunt postion
        _indoorsSurfaceViewController!.surfaceView.showsUserPosition = true




        // Load the map in a view holding it
        addSurfaceAsChildViewController()
        _indoorsSurfaceViewController!.loadBuildingWithBuildingId(MyBuildingId)


        // Route snaping
        Indoors.instance().enablePredefinedRouteSnapping()


        // Display All Zones
        _indoorsSurfaceViewController!.surfaceView.setZoneDisplayMode(IndoorsSurfaceZoneDisplayModeAllAvailable)


        // Set visible map
        let mapRect: CGRect = _indoorsSurfaceViewController!.surfaceView.visibleMapRect
        _indoorsSurfaceViewController!.surfaceView.setVisibleMapRect(mapRect, animated: true)


        // Filters
        Indoors.instance().enableStabilisationFilter = true
        Indoors.instance().stabilisationFilterTime = 4000



    }







// Add the map to the view controller
func addSurfaceAsChildViewController () {
    self.addChildViewController(_indoorsSurfaceViewController!)
    //_indoorsSurfaceViewController!.view.frame = self.view.frame
    _indoorsSurfaceViewController!.view.frame = CGRectMake(0 , 0, self.view.frame.width, self.view.frame.height * 0.7)

    self.view.addSubview(_indoorsSurfaceViewController!.view)
    _indoorsSurfaceViewController!.didMoveToParentViewController(self)
}


func buildingLoaded(building : IDSBuilding!) {
    _currentBuilding = building
    self.calculateRoute(_currentBuilding)
    print("@@@@@@@@@@@@@@@@@@")
}


func calculateRoute(building : IDSBuilding!) {
    let start = IDSCoordinate(x: 1, andY: 111, andFloorLevel: 0);
    let end = IDSCoordinate(x: 1, andY: 111, andFloorLevel: 0);
    let path = [start, end]


    Indoors.instance().routeFromLocation(start, toLocation: end, inBuilding: building, delegate: self)
    self.setRoute(path)

}

// MARK: RoutingDelegate

func setRoute(path: [AnyObject]!) {
    _indoorsSurfaceViewController!.surfaceView.showPathWithPoints(path)
}



}
</code></pre>

<p>extension ViewController {
    // MARK: ISIndoorsSurfaceViewControllerDelegate</p>

<pre><code>func indoorsSurfaceViewController(indoorsSurfaceViewController: ISIndoorsSurfaceViewController!, isLoadingBuildingWithBuildingId buildingId: UInt, progress: UInt) {
    NSLog("Building loading progress: %lu", progress)
}

func indoorsSurfaceViewController(indoorsSurfaceViewController: ISIndoorsSurfaceViewController!, didFinishLoadingBuilding building: IDSBuilding!) {
    NSLog("Building loaded successfully!")

    // By Mohammed Hassan
    UIAlertView(title: "Indoors", message: "Building loaded successfully!", delegate: nil, cancelButtonTitle: nil, otherButtonTitles: "ok").show()




}

func indoorsSurfaceViewController(indoorsSurfaceViewController: ISIndoorsSurfaceViewController!, didFailLoadingBuildingWithBuildingId buildingId: UInt, error: NSError!) {
    NSLog("Loading building failed with error: %@", error)

    UIAlertView(title: error!.localizedDescription, message: error!.localizedFailureReason!, delegate: nil, cancelButtonTitle: nil, otherButtonTitles: "ok").show()
}

// MARK: IndoorsServiceDelegate

func onError(indoorsError: IndoorsError!) {

}

func locationAuthorizationStatusDidChange(status: IDSLocationAuthorizationStatus) {




}

func bluetoothStateDidChange(bluetoothState: IDSBluetoothState) {


}



}
</code></pre>