I've looked through the documentation of polyline and there is no option to make it dashed.
Do anybody know how to draw dashed polyline with android google map sdk v2?
I've looked through the documentation of polyline and there is no option to make it dashed.
Do anybody know how to draw dashed polyline with android google map sdk v2?
I created the following function to draw dotted polyline with a list of LatLng points. This algorithm creates lines of 0.002 kms (followed by 0.002 kms meter gaps) irrespective of zoom. This is useful when you don't want to re-plot polylines when zoom changes.
Util class to calculate distance between two LatLng:
Note: The above algorithm generates very large number of polylines which may take time to render. It is useful only when the list of points is small.
Alexey, I've just created a function that worked for me and I think that will help you:
Now in Polyline you can set the pattern to be Dash, Dot or Gap simply apply the following
It is not possible in current release. Follow this issue for updates: https://code.google.com/p/gmaps-api-issues/issues/detail?id=4633
UPDATE
Recently, Google implemented this feature for polylines in Google Maps Android API v2 and marked issue 4633 as Fixed.
See information about stroke patterns 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