1

Many threads on this topic, and finally found a answer that will work - using MapQuest API.

But now it is closed.

http://devblog.mapquest.com/2015/05/01/looking-for-a-free-open-appkey-read-this/

I tried the Google Maps API, so many keys tried them all noting worked - too much effort for something so simple so not using Google Maps.

I found this, https://github.com/Project-OSRM/osrm-backend/wiki/Server-api

Works great - clean and simple but doesn't allow a set start and end location. Just best route when passing in a list.

There is also this, http://www.gebweb.net/optimap/ not sure if I can access the API ?

Anyone solved this issue ? Maybe I could just do a local sort using the items long / lat position and calculate the distance between points rather than use an API ?

Using something like this

        waypoints.sort {
            let distanceA = newStart.location.distanceBetween($0.location)
            let distanceB = newStart.location.distanceBetween($1.location)
            return distanceA < distanceB
        }
DogCoffee
  • 19,820
  • 10
  • 87
  • 120
  • 1
    Finally, in the end I used the Google API. Pass in all my data, set optimisation and get a JSON package back. Which contains an array showing the best order of way points. My Issue with Google's request was there example left out "&v=3" on the end. Hence the request failure. Also seems you dont need an API key for V3 either. This https://developers.google.com/maps/documentation/directions/ was great. Also, this http://www.appcoda.com/google-maps-api-tutorial/ to assist in reading the JSON. – DogCoffee Jun 03 '15 at 06:34

0 Answers0