1

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

Haris
  • 12,120
  • 6
  • 43
  • 70

2 Answers2

2

use

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

or

new GHRequest(pointList)
Karussell
  • 17,085
  • 16
  • 97
  • 197
0

add via point in android osm map using GraphHoppe in the following code

GHRequest req = new GHRequest();
req.addPoint(new GHPoint(fromLat, fromLon));
req.addPoint(new GHPoint(via1lat, via1lon));
req.addPoint(new GHPoint(via2lat, via2lon));
req.addPoint(new GHPoint(toLat, toLon));
GHResponse resp = hopper.route(req);

thanks Karussell