scripts/routeCreation.js
/**
 * Driver function for calculating additional information (including the distance and time duration) 
 * between each coordinate in the entire DirectionsRoute
 * @param {DirectionsStep} currentStep The current step of a DirectionsLeg
 * @param {number} currentStepIndex The index of the step in the current DirectionsLeg
 * @param {number} currentCoordIndex The index of the current coordinate being processed in the currentStep
 * @param {ModelSimulator} simulator The simulator to create a route for
 */
Driver function for calculating additional information (including the distance and time duration)
between each coordinate in the entire DirectionsRoute
@param {DirectionsStep} currentStep The current step of a DirectionsLeg
@param {number} currentStepIndex The index of the step in the current DirectionsLeg
@param {number} currentCoordIndex The index of the current coordinate being processed in the currentStep
@param {ModelSimulator} simulator The simulator to create a route for
Driver function for calculating additional information ( including the distance and time duration ) between each coordinate in the entire DirectionsRoute @param { DirectionsStep } currentStep The current step of a DirectionsLeg @param { number } currentStepIndex The index of the step in the current DirectionsLeg @param { number } currentCoordIndex The index of the current coordinate being processed in the currentStep @param { ModelSimulator } simulator The simulator to create a route for
function determineAdditionalPathDetails(currentStep, currentStepIndex, currentCoordIndex, simulator) {
	var stepDistance = currentStep.distance.value;
	var coord = currentStep.path[currentCoordIndex];
	var nextCoordDistance = calculatePathDetailsDistance(currentStep, coord, currentCoordIndex);
	var timeToNextCoord = calculatePathDetailsDuration(currentStep, nextCoordDistance, stepDistance);
	addToPathDetails(coord, currentStepIndex, nextCoordDistance, timeToNextCoord, simulator);
}
function determineAdditionalPathDetails ( currentStep , currentStepIndex , currentCoordIndex , simulator ) { var stepDistance = currentStep . distance . value ; var coord = currentStep . path [ currentCoordIndex ] ; var nextCoordDistance = calculatePathDetailsDistance ( currentStep , coord , currentCoordIndex ) ; var timeToNextCoord = calculatePathDetailsDuration ( currentStep , nextCoordDistance , stepDistance ) ; addToPathDetails ( coord , currentStepIndex , nextCoordDistance , timeToNextCoord , simulator ) ; }
Driver function for calculating additional information (including the distance and time duration)
 between each coordinate in the entire DirectionsRoute
 @param {DirectionsStep} currentStep The current step of a DirectionsLeg
 @param {number} currentStepIndex The index of the step in the current DirectionsLeg
 @param {number} currentCoordIndex The index of the current coordinate being processed in the currentStep
 @param {ModelSimulator} simulator The simulator to create a route for
Driver function for calculating additional information ( including the distance and time duration ) between each coordinate in the entire DirectionsRoute @param { DirectionsStep } currentStep The current step of a DirectionsLeg @param { number } currentStepIndex The index of the step in the current DirectionsLeg @param { number } currentCoordIndex The index of the current coordinate being processed in the currentStep @param { ModelSimulator } simulator The simulator to create a route for