Toni is not wrong in what he says and in fact, answers your question exactly. However, an alternative option based on what you are trying to achieve could be to encode the addresses.
const from = encodeURIComponent(@All of address[0]);
const to = encodeURIComponent(@All of Base[0]);
const baseUrl = 'https://www.google.com/maps/dir/';
const fLink = `${baseUrl}${from}/${to}`;
`
${fLink}
[Click here to get directions](${fLink})
`
is the encoded web link represented in the code as ${fLink}
is the long complex link hidden behind some words using markdown. which is the last line of the code above
I hope that makes sense
Jason
P.S: While it is not ideal if you put your URL with spaces into a markdown (as I have done in my example) or HTML link in the calculation block then the link will most likely work however as it is so easy in tape to encode the address I would recommend that, it also will deal with any other characters in the address that may not be liked in a link.
This opens good in same window. Any chance to open in new tab but also to work on mobile device ?
Jason,
Also … Can I get total distance in miles and display under the “Click here to get directions” with your method? Driving miles - Im assuming from google maps - driving option 1st.
const from = encodeURIComponent(@All of address[0]);
const to = encodeURIComponent(@All of Base[0]);
const baseUrl = 'https://www.google.com/maps/dir/';
const fLink = `${baseUrl}${from}/${to}`;
`
<a href="${fLink}" target="_blank" rel="noopener noreferrer">Click here to get directions</a>
`
Distance you would need an API call, I show a Google distance here:
Then this one shows some more options:
The distance matrix in my screenshot is generated from calls to the Mapbox API and is more complex.
I want to just say Hot, very very hot! but the post has to be longer than that so I would say at a rough approximation something between 7 and 8 thousand degrees Celsius