I am working with OSMDroid, I have a collections of Geopoints and then I create a Polyline like this:
private void drawPolyline(ArrayList<GeoPoint> polyline) {
Polyline line = new Polyline(this);
line.setPoints(polyline);
line.setWidth(5f);
line.setGeodesic(true);
mv_map.getOverlays().add(line);
mv_map.invalidate();
}
This code works fine, but the problem is that I need to focus this route in a map. I know I could find a mid point and center the map to it, but I don't know how to set the correct zoom and I don't know if there is already a way to find the center of the polyline more efficiently.
Thank you.