function addSummaryToPanel(route) {
		let duration = 0,
			distance = 0;

		route.sections.forEach((section) => {
			distance += section.travelSummary.length;
			duration += section.travelSummary.duration;
		});

		var summaryDiv = document.createElement('div'),
			content =
				'<b>Total distance</b>: ' +
				distance +
				'm. <br />' +
				'<b>Travel Time</b>: ' +
				toMMSS(duration) +
				' (in current traffic)';

		summaryDiv.style.fontSize = 'small';
		summaryDiv.style.marginLeft = '5%';
		summaryDiv.style.marginRight = '5%';
		summaryDiv.innerHTML = content;
		$('#outputDirections').append(summaryDiv);
	}
// Function to add the summary to the directions panel
Function to add the summary to the directions panel
Function to add the summary to the directions panel
function addSummaryToPanel(route) {
		let duration = 0,
			distance = 0;
		route.sections.forEach((section) => {
			distance += section.travelSummary.length;
			duration += section.travelSummary.duration;
		});
		var summaryDiv = document.createElement('div'),
			content =
				'<b>Total distance</b>: ' +
				distance +
				'm. <br />' +
				'<b>Travel Time</b>: ' +
				toMMSS(duration) +
				' (in current traffic)';
		summaryDiv.style.fontSize = 'small';
		summaryDiv.style.marginLeft = '5%';
		summaryDiv.style.marginRight = '5%';
		summaryDiv.innerHTML = content;
		$('#outputDirections').append(summaryDiv);
	}
function addSummaryToPanel ( route ) { let duration = 0 , distance = 0 ; route . sections . forEach ( ( section ) => { distance += section . travelSummary . length ; duration += section . travelSummary . duration ; } ) ; var summaryDiv = document . createElement ( 'div' ) , content = '<b>Total distance</b>: ' + distance + 'm. <br />' + '<b>Travel Time</b>: ' + toMMSS ( duration ) + ' (in current traffic)' ; summaryDiv . style . fontSize = 'small' ; summaryDiv . style . marginLeft = '5%' ; summaryDiv . style . marginRight = '5%' ; summaryDiv . innerHTML = content ; $ ( '#outputDirections' ) . append ( summaryDiv ) ; }
Function to add the summary to the directions panel
Function to add the summary to the directions panel