I am working on my project in which I need to calculate distances of 23 driving routes in Google map. I have the code here. The Lat and lng are already set up in js but I on
The free API has a limitation of 8 waypoints (plus the 2 endpoints give 10). The paid API allows 23 waypoints.
from the documentation
The maximum allowed waypoints is 8, plus the origin, and destination. Maps API for Business customers are allowed 23 waypoints, plus the origin, and destination. Waypoints are not supported for transit directions.
You can try chaining multiple requests together like this, but beware the DirectionsService is subject to rate limits and quotas, so that might not always work.
example with your points