LuZa
LuZa

Reputation: 450

Offline routing in OSM - android

I just built an offline map on android using osmdroid.

I'm able to draw Polylines over offline tiles using my stored waypoints.

ArrayList<GeoPoint> waypoints = my_waypoints_from_json;
RoadManager roadManager = new OSRMRoadManager(m_activity);
road = roadManager.getRoad(waypoints);
Polylines roadOverlay = RoadManager.buildRoadOverlay(road, m_activity);

Is it possible to draw offline route between two location ? ( If i'm using map in offline mode and I want to draw line from source to destination. )

Upvotes: 2

Views: 978

Answers (1)

Josef Adamcik
Josef Adamcik

Reputation: 5780

OSRMRoadManager works only online, it needs an API to call in order to figure out the route. There are no routing data included in your offline tiles, they are just pure bitmaps.

One option how to solve this problem is using the Graphopper library. You are going to need to include the java libary in your app and generate and distribute the data for offline navigation. It's not a trivial process, but it can be done.

Upvotes: 3

Related Questions