这是我的代码应该告诉我两点之间的路线。
RoadManager roadManager = new OSRMRoadManager();
roadManager.addRequestOption("routeType=bicycle");
ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>();
waypoints.add(gp);
waypoints.add(new GeoPoint(48.92608,9.13641 )); //end point
Road road = roadManager.getRoad(waypoints);
Polyline roadOverlay = RoadManager.buildRoadOverlay(road, this);
mapView.getOverlays().add(roadOverlay);
mapView.invalidate();
Drawable nodeIcon = getResources().getDrawable(R.drawable.marker_node);
for (int i=0; i<road.mNodes.size(); i++){
RoadNode node = road.mNodes.get(i);
Marker nodeMarker = new Marker(mapView);
nodeMarker.setPosition(node.mLocation);
nodeMarker.setIcon(nodeIcon);
nodeMarker.setTitle("Step "+i);
mapView.getOverlays().add(nodeMarker);
nodeMarker.setSnippet(node.mInstructions);
nodeMarker.setSubDescription(Road.getLengthDurationText(node.mLength, node.mDuration));
Drawable icon = getResources().getDrawable(R.drawable.ic_continue);
nodeMarker.setImage(icon);
}
但这只显示了蜜蜂线(航空公司)。 为什么我看不到车道的正常路线?