how to know which route belongs to which location

When i create an optimized route, i want to be able to create directions and uniquely identify each point on the map with a customer name. I have a list of customers and each customer has a lattitude and longitude.

The result is added to the leaflet map. The map shows A, B and C. But those points are not labeled. And when i create the route directions, i am unable to determine with absolute certainty which leg belongs to which customer object. The maneuver.startPoint lat/lng is not always identical to the original lat/lng.

The response includes a locationSequence which indicates what order the original list of locations was re-ordered for the list. The first and last will always match the input but the locations between them can be re-ordered.

Hi MQBrianCoakley !
can you link an explampe or a use description of locationSequence in leaflet ?
I need to retrieve the exact list of stop calculated by you but I have found no example or description in doc

The description in the documentation is that the locationSequence, "Returns a sequence array that can be used to determine the index in the original location object list." So if the locationSequence returned is 0,2,1,3 then the first location returned (locationSequence[0]) is the first location in the request (0), the second location returned (locationSequence[1]) is the third location (2) in the request, the third location returned (locationSequence[2]) is the second location in the request (1), and the fourth location returned (locationSequence[3]) is the fourth location in the request (3). The first and last locations in the request will remain the first and last locations in the response. Using this you can reference the original list of locations in their array.

About MapQuest for Business

MapQuest for Business powers thousands of businesses with
location-enabled Geospatial solutions. Our platform provides companies of any size
with the means to increase efficiency and streamline processes, connect with
customers, and ultimately deliver the all-important exceptional user experience.
And, as usual, the MapQuest for Business experience is backed by the customer
service and technical support that we're known for.