function calculateRouteFromAtoB(platform, locations) {
		var router = platform.getRoutingService(null, 8),
			routeRequestParams = {
				routingMode: 'fast',
				transportMode: 'car',
				origin: locations[0].position.lat + ',' + locations[0].position.lng, // User's inputted address
				destination: $('#directionsSelect').val(), // Selected coffee shop
				return: 'polyline,turnByTurnActions,actions,instructions,travelSummary',
			};

		router.calculateRoute(routeRequestParams, routeOnSuccess, routeOnError);
	}
// Function to calculate the route from the user's inputted address to the selected coffee shop
Function to calculate the route from the user's inputted address to the selected coffee shop
Function to calculate the route from the user ' s inputted address to the selected coffee shop
function calculateRouteFromAtoB(platform, locations) {
		var router = platform.getRoutingService(null, 8),
			routeRequestParams = {
				routingMode: 'fast',
				transportMode: 'car',
				origin: locations[0].position.lat + ',' + locations[0].position.lng, 
				destination: $('#directionsSelect').val(), 
				return: 'polyline,turnByTurnActions,actions,instructions,travelSummary',
			};
		router.calculateRoute(routeRequestParams, routeOnSuccess, routeOnError);
	}
function calculateRouteFromAtoB ( platform , locations ) { var router = platform . getRoutingService ( null , 8 ) , routeRequestParams = { routingMode : 'fast' , transportMode : 'car' , origin : locations [ 0 ] . position . lat + ',' + locations [ 0 ] . position . lng , destination : $ ( '#directionsSelect' ) . val ( ) , return : 'polyline,turnByTurnActions,actions,instructions,travelSummary' , } ; router . calculateRoute ( routeRequestParams , routeOnSuccess , routeOnError ) ; }
Function to calculate the route from the user's inputted address to the selected coffee shop
Function to calculate the route from the user ' s inputted address to the selected coffee shop
// User's inputted address // Selected coffee shop