[GraphHopper] [Graphhopper]Next Instructions

Lau laura.barroso at hab.desoft.cu
Tue May 26 19:59:14 UTC 2015


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:fredlaurent31 at gmail.com] 
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 <devemux86 at gmail.com <mailto:devemux86 at gmail.com> >:

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
GraphHopper at openstreetmap.org <mailto:GraphHopper at openstreetmap.org> 
https://lists.openstreetmap.org/listinfo/graphhopper

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150526/d3743cce/attachment.html>


More information about the GraphHopper mailing list