如何使用GraphHopper在android OSM地图中添加多个via(路点)?
我使用以下代码从A到B
GHRequest req = new GHRequest(fromLat, fromLon, toLat, toLon);
GHResponse rsp = hopper.route(req);
在这里我如何添加另一个位置
提前感谢
使用
new GHRequest().addPoint(new GHPoint(lat, lon)).addPoint...
或
new GHRequest(pointList)
在以下代码中使用GraphHoppe在android osm地图中添加via点
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);
感谢Karussell