String points [] = routeModel.getLatlon().split("\\|");
String [] point;
ArrayList<GeoPoint> mTrace = new ArrayList<>();
for (String s : points) {
point = s.split("-");
GeoPoint gg = new
GeoPoint(Double.parseDouble(point[0]),Double.parseDouble(point[1]));
mTrace.add(gg);
}
Polyline mPolyline = new Polyline();
mPolyline.setColor(getResources().getColor(R.color.bonusColor));
mPolyline.setWidth(14.0f);
mPolyline.setPoints(mTrace);
mapView.getOverlays().add(polyline);
最佳答案
更改折线的paint的联接配置。您可能还想更改上限配置(用于折线的末端)。
例如:
mPolyline.getPaint().setStrokeJoin(Paint.Join.ROUND)
mPolyline.getPaint().setStrokeCap(Paint.Cap.ROUND)