Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is intended to extend leaflet_routing_machine with the implementation of the trip service. Trip service is an alternative to regular routing which returns an optimised route (TSP algorithm) to connect all waypoints.
Documentation and parameters of trip service are explained in http://project-osrm.org/docs/v5.22.0/api/#trip-service
These are the modifications applied:
Changes in osrm-v1.js:
Lines 21-35:
Add new properties to control if the service calls the trip (optimised) or routing urls
tripOptions: properties for the options available in trip service
Line 73 : Assign the end-point url depending on optimised.
Lines 169-185: Parse and trip service response format
Lines 365-379: Build end-point url with the appropriate parameters depending on routing/trip
Changes in line.js
Line 125: When optimise=true the result doesn´t need to follow the order of the entry coordinates. With this change we force the process to recalculate the indices of the entry waypoints in the response coordinates.