lastInstrucion is just a variable...

you have all the instrucions, correct?

GHResponse resp = hopper.route(req);

InstructionList il = resp.getInstructions();

lastInstruction is one of those Instructions….in your case you wanna to make a 
turn by turn instruction, so I suggest that you inherit the MyLocationOverlay 
class and make a start point on the onLocationChange method in order to select 
which instruction is the appropriate…there was a discussion a few months back 
on this list talking about this same issue, and there’s code too, I suggest you 
look into it.

Cheers.

 

De: Fred Laurent [mailto:[email protected]] 
Enviado el: Wednesday, May 20, 2015 8:29 AM
Para: GraphHopper Java routing engine
Asunto: Re: [GraphHopper] [Graphhopper]Instructions

 

hi Laura,

Can you show me an Example who use lastInstruction.getTurnDescription(esTR);?

because I don't find how make the constructor Instruction (in Instruction.java)

i.e what is lastInstruction ; is it Instruction.java class?

Please, thank you

Fred

 

 

2015-05-20 14:39 GMT+02:00 Fred Laurent <[email protected] 
<mailto:[email protected]> >:

Ok , Thank you .. I try this

Fred

 

2015-05-20 14:13 GMT+02:00 Lau <[email protected] 
<mailto:[email protected]> >:

Hi Fred, Why don’t you try to get the description from the instruction 
itself???? Ex:

TranslationMap trMap = new TranslationMap().doImport();

Locale l = new Locale("es");

Translation esTR = trMap.getWithFallBack(l);

lastInstruction.getTurnDescription(esTR);

 

De: Fred Laurent [mailto:[email protected] 
<mailto:[email protected]> ] 
Enviado el: Wednesday, May 20, 2015 3:51 AM
Para: GraphHopper Java routing engine
Asunto: [GraphHopper] [Graphhopper]Instructions

 

Hello,
I use the last version of graphHopper from Git and In my app 
I try to show the Instruction (Like Road Book) and  my code is :

.......
 GHResponse resp = hopper.route(req);

 InstructionList il = resp.getInstructions();
 TranslationMap SINGLETON = new TranslationMap().doImport();
 Translation trad = SINGLETON.getWithFallBack(Locale.US);
  And if i try this :
 List<String> iList = il.createDescription(trad); I have an error because in 
the class instructionList.java i don't have the function " List<String> 
createDescription(Locale locale)  " ... 
Please,How make?
   I follow 
https://github.com/graphhopper/graphhopper/blob/master/docs/core/routing.md and 
http://grepcode.com/file/repo1.maven.org/maven2/com.graphhopper/graphhopper/0.1/com/graphhopper/util/InstructionList.java/#InstructionList.createDescription%28java.util.Locale%29
thank you               

 

_______________________________________________
GraphHopper mailing list
[email protected] <mailto:[email protected]> 
https://lists.openstreetmap.org/listinfo/graphhopper

 

 

_______________________________________________
GraphHopper mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/graphhopper

Reply via email to