${instruction.action.type} ${instruction.action.bearing ?? ''}
in ${Math.round(instruction.distance)} meters.
`}
/>
))}
>
);
}
```
```ts
// Get directions from the first space to the second space.
const directions = mapData.getDirections(firstSpace, secondSpace);
// Add a path from the first space to the second space.
mapView.Paths.add(directions.coordinates);
// Add markers for each direction instruction.
directions.instructions.forEach((instruction: TDirectionInstruction) => {
const markerTemplate = `
${instruction.action.type} ${instruction.action.bearing ?? ''} in ${Math.round(
instruction.distance
)} meters.
`;
mapView.Markers.add(instruction.coordinate, markerTemplate,
{
rank: 4,
});
});
```
```