The existing calculated route, a Feature with LineString geometry.
The existing waypoints in order, from origin through intermediate waypoints to destination.
The waypoints to find insertion slots for.
The insertion slot indices, one per new waypoint, in input order.
newWaypoints returns an empty array.0, so they would all prepend.0,
as in findBestWaypointInsertionIndex.
The multi-waypoint variant of findBestWaypointInsertionIndex.
It projects every existing and new waypoint onto the route exactly once, then returns one insertion slot per new waypoint. The i-th index is the slot in
existingWaypointswhere the i-th new waypoint falls by its along-route location. Slot 0 is before the origin, and slotexistingWaypoints.lengthis after the destination.Several new waypoints may share a slot. To also merge them into the existing array in along-route order, use withInsertedWaypoints, which ranks them within each slot.