I have to calculate distance between multiple points through google distance matrix API. I have a plugin which has inputs like Pickup address, pickup via, dropoff-address and then a checkbox to select return drive. If return drive box is checked, then we have return pickup, return via, return dropoff inputs.
I have used distance matrix API to calculate distance between: 1) pickup address and pickup via 2) Then pickup via to dropoff address. and then added the two.
Now if I have to calculate the return drive distance, would I need to do this same method of selecting 2 at a time or is there a prebuilt function for this?