Hi Fred

You could use this DistanceCalc to see if your current position is within the 
limit distance to the next instruction, ex:

Int number = 20;

DistanceCalc distCalc = Helper.DIST_EARTH;

                  

if (distCalc.calcDist(instruction.getPoints().getLat(0),

                                          instruction.getPoints().getLon(0),

                                          mylocation.getLatitude(), 
mylocation.getLongitude()) <= number) {

      //display instruction text or whatever you want…

String text = instruction.getTurnDescription(esTR);

Toast.makeText(context, text, Toast.LENGTH_LONG).show();

}

 

 

 

De: Fred Laurent [mailto:[email protected]] 
Enviado el: Tuesday, May 26, 2015 1:19 PM
Para: GraphHopper Java routing engine
Asunto: Re: [GraphHopper] [Graphhopper]Next Instructions

 

But How find this distance limit?

 

2015-05-26 20:14 GMT+03:00 Emux <[email protected] 
<mailto:[email protected]> >:

Check the docs of that method: "return the next Instruction or null if too far 
away".
You need to be within the distance limit for finding an instruction.

 

-- 
Emux
Cruiser <http://wiki.openstreetmap.org/wiki/Cruiser>  - Atlas 
<http://wiki.openstreetmap.org/wiki/Atlas_%28navigation_application%29> 


_______________________________________________
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