I want to create a 'distance traveled' polyline along a set route using V3 of the Google Maps API.
The polyline should pass through multiple waypoints/legs.
Currently, I am using the DirectionsService to draw the entire route.
In addition, I am utilizing epolys.js to obtain the marker position for the distance traveled.
Instead of copying the complete route into a new polyline, I only want to copy the route up to the marker position.
To see a demo, visit: http://codepen.io/1983ron/pen/wKMVQr
Here is where I am with the JavaScript code:
var geocoder;
var map;
var marker;
var gmarkers = [];
var METERS_TO_MILES = 0.000621371192;
var walked = (Math.round(670 * 1609.344));
// More JS code...
...
...
Any assistance would be greatly appreciated.