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 23a2568 commit 4b48ae6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,12 @@
function getInstructions(data, coordinates) {
// Target the sidebar to add the instructions
const directions = document.getElementById('directions');
const output = coordinates.split(';').map(pair => {
// Add formatting to the coordinates
const output = input.split(';').map(pair => {
const [lng, lat] = pair.split(',').map(Number);
return [lng, lat];
});
return `[${lng}, ${lat}]`;
}).join(',\n');
const formattedCoordinates = `[\n${output}\n]`;
let tripDirections = '';
// Output the instructions for each step of each leg in the response object
for (const leg of data.legs) {
Expand All @@ -197,7 +199,7 @@
)} min.</strong></p>
<ol>${tripDirections}</ol>
<p><strong>Coordinates:</strong></p>
<p>${output}</p>`;
<p>${formattedCoordinates}</p>`;
}

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

0 comments on commit 4b48ae6

Please sign in to comment.