Search code examples
androidopenstreetmapgraphhopper

how add via(watpoints) points in android osm map using GraphHopper


how to add multiple via(way points) in android OSM map using GraphHopper?

i am using the following code for route from A to B

GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon);
GHResponse rsp = hopper.route(req);

here how i add another location

thanks in advance


Solution

  • use

    new GHRequest().addPoint(new GHPoint(lat, lon)).addPoint...
    

    or

    new GHRequest(pointList)