答案 0 :(得分:2)
现在在Polyline中,您可以将模式设置为Dash,Dot或Gap,只需应用以下Demo
public static final int PATTERN_DASH_LENGTH_PX = 20;
public static final int PATTERN_GAP_LENGTH_PX = 20;
public static final PatternItem DOT = new Dot();
public static final PatternItem DASH = new Dash(PATTERN_DASH_LENGTH_PX);
public static final PatternItem GAP = new Gap(PATTERN_GAP_LENGTH_PX);
public static final List<PatternItem> PATTERN_POLYGON_ALPHA = Arrays.asList(GAP, DASH);
...
PolylineOptions polylineOptions = new PolylineOptions()
.geodesic(true)
.color(Color.CYAN)
.width(10)
.pattern(PATTERN_POLYGON_ALPHA);
polylineOptions.addAll(route.getPoints());
polylinePaths.add(mGoogleMap.addPolyline(polylineOptions));
...