Reputation: 399
In my app I am trying to visualize best route between two points. The route is calculated using data stored in my offline database. After some google search I have seen it is easy to visualize a route using KmlDocument. But all the example I found are Just showing how to create KmlDocument from kml file and visualize it. But in my situation it is not possible, as the route is generated dynamically. So how can I visualize the route on OSMdroid?
Upvotes: 0
Views: 356
Reputation: 3258
If you just want a line on the map that represents your route, then I'm pretty sure the class you want is Polyline.
There a few different variants which have different effects depending on what you want, such as the Milestone classes.
Examples for both are here: https://github.com/osmdroid/osmdroid/blob/master/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/drawing/CustomPaintingSurface.java#L132
I'd suggest you get the sample app from the play store, play around with what's there, then find the source to what best fits your needs and go from there.
Upvotes: 1