Draw dotted polyline on Google Map - Android

10.8k views Asked by At

I am working on an Android application that uses Google Maps and draws polylines on the map. I wanted to know if there is a way to draw a dotted polyline (similar to the one Google Maps shows when displaying a walking route) and how should I do that.

I have looked into the PolylineOptions object but I didn't find a method that would help me.

Is there a way do draw a dotted polyline? If so what is the method?

Thanks.

1

There are 1 answers

2
xomena On BEST ANSWER

As of February 2017, Google released a new set of customizations for polylines and polygons in Google Maps Android API v2. Now you can create dashed or dotted polylines.

See information about new features in the Shapes Guide. See an example in the Polylines and Polygons tutorial.

You can also read the corresponding blog post here:

https://maps-apis.googleblog.com/2017/02/styling-and-custom-data-for-polylines.html