2

I Can't get Real Path between two points , I got a direct line between them, here is my sample code, I put that code under onCreate method , also I tried to handle it by runnable but without getting a worth result , just a direct line between two points

GeoPoint startPoint = new GeoPoint(48.2,-1.88) ; 
RoadManager roadManager = new OSRMRoadManager();
ArrayList waypoints = new ArrayList(); 
waypoints.add(startPoint); GeoPoint endPoint = new GeoPoint(48.4, -1.9); 
waypoints.add(endPoint);
Road road = roadManager.getRoad(waypoints);
Polyline roadOverlay = RoadManager.buildRoadOverlay(road, this);
map.getOverlays().add(roadOverlay);
map.invalidate();

Any advice, suggestions or help ?

  • 1
    Likely a duplicate with this one: http://stackoverflow.com/questions/21213224/roadmanager-for-osmdroid-error/21894178#21894178 – MKer Apr 12 '16 at 21:12
  • @MKer I checked the link , the version of android which I used is API 22 , then I got the following URL in logcat , it seems that I got a response without drawing the real path, please check and advise ?http://router.project-osrm.org/viaroute?&loc=48.129999999999995,-1.63&loc=48.099999999999994,-1.6099999999999999&instructions=true&alt=false – Anas Quedan Apr 13 '16 at 15:09
  • @MKer I got in mStatus = 200 , also when I set log.i inside mStatus != ok . I got the log in the logcat , so what is the problem related to and how can i solved it even if i got the road, I mentioned the url in the previous comment . Can you help , I need this .... Many thanks – Anas Quedan Apr 13 '16 at 15:28
  • 1) Please provide the relevant section of your logcat. 2) Which version of OSMBonusPack are you using? 3) You are using API 22: did you read this: https://github.com/MKergall/osmbonuspack/wiki/Tutorial_0#important-note-about-network-calls ? – MKer Apr 14 '16 at 17:21
  • am using 4.5, you mean that you need a copy of logcat behind that url ? – Anas Quedan Apr 15 '16 at 12:42
  • Here is the log :: 04-15 16:58:24.317 16801-16801/com.android.application.osm D/BONUSPACK: OSRMRoadManager.getRoad:http://router.project-osrm.org/viaroute?&loc=48.129999999999995,-1.63&loc=48.12,-1.5&instructions=true&alt=false 04-15 16:58:24.331 16801-16801/com.android.application.osm W/System.err: at org.osmdroid.bonuspack.routing.OSRMRoadManager.getRoad(OSRMRoadManager.java:205) 04-15 16:58:24.331 16801-16801/com.android.application.osm E/BONUSPACK: OSRMRoadManager::getRoad: request failed. – Anas Quedan Apr 15 '16 at 14:02
  • I got this message many times : OSRMRoadManager::getRoad: request failed. – Anas Quedan Apr 15 '16 at 16:15

0 Answers0