diff --git a/index.html b/index.html index 0e8b3ab..5f0da0a 100644 --- a/index.html +++ b/index.html @@ -180,12 +180,12 @@ function getInstructions(data, coordinates) { // Target the sidebar to add the instructions const directions = document.getElementById('directions'); - // Add formatting to the coordinates - const output = input.split(';').map(pair => { + // Format the coordinates + const coords = coordinates.split(';').map(pair => { const [lng, lat] = pair.split(',').map(Number); return `[${lng}, ${lat}]`; }).join(',\n'); - const formattedCoordinates = `[\n${output}\n]`; + const formattedCoords = `[\n${coords}\n]`; let tripDirections = ''; // Output the instructions for each step of each leg in the response object for (const leg of data.legs) { @@ -199,7 +199,7 @@ )} min.

    ${tripDirections}

Coordinates:

-

${formattedCoordinates}

`; +

${formattedCoords}

`; } // Draw the Map Matching route as a new layer on the map