Returns a new array of waypoints with each new waypoint inserted at its optimal position.
The multi-waypoint variant of withInsertedWaypoint. Unlike one-at-a-time insertion,
it projects every existing and new waypoint onto the route exactly once, then merges them:
Returns a new array of waypoints with each new waypoint inserted at its optimal position.
The multi-waypoint variant of withInsertedWaypoint. Unlike one-at-a-time insertion, it projects every existing and new waypoint onto the route exactly once, then merges them:
The result holds the existing waypoints with the new ones spliced in at the right positions, in along-route order, whatever the input order.