I would like to order a Location(Latitude & longitude), such that the driving distance is the shortest. When I have three points it would not matter going form A to B to C back to A or from A to C to B and back to A. Using Bing maps REST API.
Bing Maps has a new distance matrix service in preview which you can use to calculate these distances. You can find info on it here: https://labs.cognitive.microsoft.com/en-us/project-abu-dhabi
Not sure what you mean by sort;
- If you simply want to sort by distance from A to a list of locations (B, C...) then once you have the distance information this would be a simple array sort call.
- If you want to calculate the shortest route between all points, then this would be a travelling sales men problem and require a lot more code. There are a lot of different algorithms for doing this online. I have a few samples using Bing Maps somewhere on my computer, will see if I can find some time to clean them up and get them online.