I'm trying to setup up a basic OSRM / openlayers map.
I have been able to create an openlayers app with a map and some data. I have also compiled my own version of the OSRM server and tested it to return data.
I would now like to use it. And having searched around I see people asking complicated questions, but nowhere is there a basic example of how to use it. I have seen some of the websites that use it, but they usually minimize/obfuscate the code and it's difficult to get a basic idea of whats happening there.
The two main things I would like to do are:
Return a bike/walk route form the OSRM server, from what I understand the server only does car routes but in almost every live site I see they have walk and bike paths. How is this accomplished.
This should have been one probably. I need the most basic example of how to call the server function and then display it on the map.
I know I can create the URL call that's not a problem but it returns a .json file which I'm having trouble loading into my app. Apparently it accepts the the callback parameter but I'm not 100% sure what to do with it. Also the data comes back as an encoded and I'm having trouble with understanding the encoded polyline isssues.
So what I would like here is a basic example or a link to an existing one that does:
- call the server url
- the success function adds the data to the openlayers map and displays it.