Osmdroid 中多段线之间的空间

Spaces between Polylines in Osmdroid

我正在尝试在地图 (osm) 上绘制轨迹。但是在尖角app spaces

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)