Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
ColstonBod-oy authored Jul 5, 2024
1 parent 4b48ae6 commit a26c899
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -199,7 +199,7 @@
)} min.</strong></p>
<ol>${tripDirections}</ol>
<p><strong>Coordinates:</strong></p>
<p>${formattedCoordinates}</p>`;
<p>${formattedCoords}</p>`;
}

// Draw the Map Matching route as a new layer on the map
Expand Down

0 comments on commit a26c899

Please sign in to comment.