Reputation: 11
I have found that Google map provides PolylineOptions but I haven't been able to find anything for Osmdroid.
If any one can suggest a solution with an example it would be very helpfull.
Upvotes: 2
Views: 1592
Reputation: 5780
You may not be able to draw a real curved line, but you should be able to create a Polyline which would appear to be curved. Polyline composes from straight line segments which are not curved.
It's seems that also the Google Map API you are referring to supports only Polylines without curves. See Google Map documentation
A Polyline is a series of connected line segments that can form any shape you want and can be used to mark paths and routes on the map.
Polylines and Polygons are supported by the Osmdroid library. Detail can be found in the Osmdroid documentation.
You can create Polyline easily:
List<GeoPoint> geoPoints = new ArrayList<>();
geoPoints.add(start);
//... add other points that should form the curve
geoPoints.add(end);
//add your points here
Polyline line = new Polyline(); //see note below!
line.setPoints(geoPoints);
map.getOverlayManager().add(line);
The tricky part would be to compute the points between your two known coordinates.
Upvotes: 1