scripts/routeCreation.js
/**
 * Determine the distance from one coordinate to the next in a DirectionsStep
 * @param {DirectionsStep} currentStep The current step of a DirectionsLeg
 * @param {LatLng} coord A coordinate in the currentStep
 * @param {number} coordIndex The index of coord in the currentStep
 */
Determine the distance from one coordinate to the next in a DirectionsStep
@param {DirectionsStep} currentStep The current step of a DirectionsLeg
@param {LatLng} coord A coordinate in the currentStep
@param {number} coordIndex The index of coord in the currentStep
Determine the distance from one coordinate to the next in a DirectionsStep @param { DirectionsStep } currentStep The current step of a DirectionsLeg @param { LatLng } coord A coordinate in the currentStep @param { number } coordIndex The index of coord in the currentStep
function calculatePathDetailsDistance(currentStep, coord, coordIndex) {
	var numCoordsInStep = currentStep.path.length;
	var distance;
	if(coordIndex == numCoordsInStep - 1)
		distance = 0;
	else
		distance = ModelSimulator.geHelper.distance(coord, currentStep.path[coordIndex + 1]); 
	return distance;
}
function calculatePathDetailsDistance ( currentStep , coord , coordIndex ) { var numCoordsInStep = currentStep . path . length ; var distance ; if ( coordIndex == numCoordsInStep - 1 ) distance = 0 ; else distance = ModelSimulator . geHelper . distance ( coord , currentStep . path [ coordIndex + 1 ] ) ; return distance ; }
Determine the distance from one coordinate to the next in a DirectionsStep
 @param {DirectionsStep} currentStep The current step of a DirectionsLeg
 @param {LatLng} coord A coordinate in the currentStep
 @param {number} coordIndex The index of coord in the currentStep
Determine the distance from one coordinate to the next in a DirectionsStep @param { DirectionsStep } currentStep The current step of a DirectionsLeg @param { LatLng } coord A coordinate in the currentStep @param { number } coordIndex The index of coord in the currentStep
/* If there are no more coordinates in the currentStep, the distance to the next one is zero.
	 * However, as all steps but the last one share their last coordinate with the first coordinate of the next step
	 * (the last step only shares its _first_ coordinate with the _last_ coordinate of the _previous step_), the
	 * distance from the current coordinate to the next unique coordinate will be determined when the next step is
	 * processed (assuming a next step exists).
	 *
	 * Since the last coordinate of a step usually matches the first coordinate of
	 * the next step, the distance between these coordinates is 0 */ //Get the distance between the current coordinate and the next one