I am searching for a solution for my current OpenLayers 3 application. We are now in need of adding what seems to be map routing. I have a small area, a building and a parking lot (about 5 or 6 acres) that does not have normal roads populated on it in OSM. I need to be able to add functionality so that a user is able to navigate from their current location (using ol3 geolocation) to another feature on the map.

This seems like it would not be difficult, however there are rooms and hallways in the building that are in this space so I need something that will be able to route lines on a path to help navigate the user from wherever they are. Basically I am looking for something similar to Google maps driving directions but not for driving, or on roads, but inside a building/parking lot. I did look on Google maps, and they have the room outlines, and hallway outlines that I would need. I am not sure how they obtain that data or how I could represent that in my own map and add routing around that.

I looked into OSRM but I am not sure it is the solution I will need.

Does anyone have a book or tutorial to recommend?

1 Answer 1


The question is more related with data and routing than OpenLayers 3. Since you only need to provide guidance in a small area, I would suggest to:

  • add the missing data to OpenStreetMap. You win and OpenStreetMap also wins detailed data.
  • use a routing engine able to import OpenStreetMap data, like OpenTripPlanner.
  • on your OpenLayers application, call the routing engine to compute the route and use the resulting line to give feedback to the user. See how the default OpenTripPlaner viewer works.

I mentioned OpenTripPlanner because you might want to calculate routes within areas and it can do that.

  • Am I able to host OpenTripPlanner on a node server? Also, what does the process of adding to OSM entail?
    – Truextacy
    Commented Mar 23, 2017 at 15:28
  • This fiddle comes very close to what I am trying to achieve, the only issue here is that It does not register on 'uncharted' (I do not know the correct term) areas. Is there a way I can add paths to this? If so, how? jsfiddle.net/jonataswalker/079xha47
    – Truextacy
    Commented Mar 23, 2017 at 16:06
  • If I undestand, you need to compute routes across squares, as in Piazza de S. Marcos. I've tested the fiddle provided and it does not compute routes accross areas. I've selected to points outside a square (in front of the market) and the result for walking (I've changed the routing to url_osrm_route = '//router.project-osrm.org/route/v1/foot/') is not suitable. You need to check how this can be done with OSRM (or you might want to try OTP).
    – jgrocha
    Commented Mar 25, 2017 at 18:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.