scripts/routeCreation.js
/**
 * Driver function for calculating directions with Google Maps.
 * Retrieves all required values from the Menu Form and then packages them up to
 * get directions using the Google Maps DirectionsService
 * @callback modelCreationCB Callback function to start parsing the entered model
 * @param {ModelSimulator} simulator The simulator to create a route for
 */
Driver function for calculating directions with Google Maps.
Retrieves all required values from the Menu Form and then packages them up to
get directions using the Google Maps DirectionsService
@callback modelCreationCB Callback function to start parsing the entered model
@param {ModelSimulator} simulator The simulator to create a route for
Driver function for calculating directions with Google Maps . Retrieves all required values from the Menu Form and then packages them up to get directions using the Google Maps DirectionsService @callback modelCreationCB Callback function to start parsing the entered model @param { ModelSimulator } simulator The simulator to create a route for
function routeCreationDriver(modelCreationCB, simulator) {
	var wasCustomRouteEntered = customItemEntered($("#route"));
	var errorDiv;
	var errorDivTxt;
	if(wasCustomRouteEntered) {
		errorDiv = $("#customRouteError");
		errorDivTxt = $("#customRouteError_zeroResults");
	}
	else {
		errorDiv = $("#noRouteSelected");
		errorDivTxt = $("#selectedRoute_zeroResults");
	}
	var routePoints = getEnteredRouteValues(new Object(), wasCustomRouteEntered);
	var transitType = determineTransitType();
	var directionsRequest = createDirectionsRequest(routePoints, transitType);
	getDirections(directionsRequest, errorDiv, errorDivTxt, modelCreationCB, simulator);
}
function routeCreationDriver ( modelCreationCB , simulator ) { var wasCustomRouteEntered = customItemEntered ( $ ( "#route" ) ) ; var errorDiv ; var errorDivTxt ; if ( wasCustomRouteEntered ) { errorDiv = $ ( "#customRouteError" ) ; errorDivTxt = $ ( "#customRouteError_zeroResults" ) ; } else { errorDiv = $ ( "#noRouteSelected" ) ; errorDivTxt = $ ( "#selectedRoute_zeroResults" ) ; } var routePoints = getEnteredRouteValues ( new Object ( ) , wasCustomRouteEntered ) ; var transitType = determineTransitType ( ) ; var directionsRequest = createDirectionsRequest ( routePoints , transitType ) ; getDirections ( directionsRequest , errorDiv , errorDivTxt , modelCreationCB , simulator ) ; }
Driver function for calculating directions with Google Maps.
Driver function for calculating directions with Google Maps .