If you are interested in the programmatic solution a rough plan of the workflow is as follows:
- Grab the CSV and turn it into an array
- Loop thru the points of the result array
- For each pair of points calculate the driving distance between them which will also pass back an array of points that is used to plot the polyline.
- Collect these arrays and then loop thru this array of arrays to plot all polylines.
Alternatively, if you don't have that many points in your CSV, you can use the following route request of the google directions api.
Note that the waypoints of the route are separated with the pipe characters (|).
You can also modify the order of your waypoints by setting the
waypoint_order field, like
"waypoint_order": [ 1, 0, 2, 3 ]
I hope I helped!