GraphHopper.com | Forum | GitHub | Maps | Blog

Cant get method getInstructions in graphopper-ios using swift


#1

hi this is mi code for initialize graphhoper

func initGraphhoper(){
    let location: String? = Bundle.main.path(forResource: "graph-data", ofType: "osm-gh")
    self.hopper = GraphHopper()
    self.hopper.setCHEnabledWithBoolean(false)
    self.hopper.setEnableInstructionsWithBoolean(true)
    self.hopper.setAllowWritesWithBoolean(true)
    self.hopper.setEncodingManagerWith(EncodingManager.init(nsString: "car,foot,bike"))
    self.hopper.forMobile()
    self.hopper.load__(with: location)
}

and i am trying to get the instructions for the path in this way

let path : PathWrapper = result.getBest()
let instructions = path.getInstructions()

but xcode give me this error
Value of type ‘PathWrapper’ has no member getInstructions

Any help


#2

Any one can help me?


#3

add this in your bridging header :

#import “com/graphhopper/util/InstructionList.h”