Everything is functioning smoothly in the code below:
direction.route(
{
start: '30 Baker St, Old City, YY 12345',
end: '30 Bogus Address Ave, Fake, ZZ 12345',
waypoints: [ "<address1>", "<address2>" ] //Using literals in an array
});
The issue I am encountering is the possibility of having numerous addresses stored in an array. The quantity of addresses within the array may fluctuate.
The following code would suffice, but I require the ability to dynamically construct the array within the JS object.
direction.route(
{
start: '30 Baker St, Old City, YY 12345',
end: '30 Bogus Address Ave, Fake, ZZ 12345',
waypoints: [ address[0], address[1], address[2], ... ] //Using variables in an array
});