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.
{id: 1, name: 'customer1', lattitude: 48, longitude: 122}
{id: 2, name: 'customer2', lattitude: 49, longitude: 122}
{id: 2, name: 'customer3', lattitude: 50, longitude: 122}
I map this list to an array of locations:
[ {latLng:{lat:48,lng122}},{latLng:{lat:49,lng122}},{latLng:{lat:50,lng122}} ]
I get an optimized route from the directions object:
dir = MQ.routing.directions().on('success', data => {
...create route directions...
});
dir.optimizedRoute({locations:locations});
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.
How can i identify which leg belongs to which customer?
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
Many thanks
This array is not available on Leaflet right ?
I need to make a call in json or xml to receive back these data ?
Unfortunately I have tried some methods for extract locationSequence data without success