The existing calculated route, a Feature with LineString geometry.
The existing waypoints in order, from origin through intermediate waypoints to destination.
A new array with the waypoints inserted at their optimal positions.
existingWaypoints unmodified.newWaypoints array returns a shallow copy of existingWaypoints.
Returns a new array of waypoints with each new waypoint inserted at its optimal position.
The multi-waypoint variant of withInsertedWaypoint: it takes each new waypoint's slot from findBestWaypointInsertionIndices, and splices the new waypoints in along-route order, whatever their input order.